Html content to PNG file - symfony

In php,Is it possible to convert the whole html content to IMAGE(PNG).I tried out with gd library the image is created but image shows white screen.Can any one help me to solve this issue.

I recommend
https://github.com/KnpLabs/KnpSnappyBundle
as this can export html content to an image file.
great documentation can also provided

Related

img styling is changing the way emojis are displayed

I have a GatsbyJS website that uses NetlifyCMS. I restyled the images on my website to be centered. The issue i've found now is that all the emojis in the blog posts are now also in a new line and centered in the posts and it doesn't look good at all.
Is there anyway to style the img and emojis seperately? I am aware that emojis show up on the markdown file as images.
I have attached images of how the emojis look in the blog posts, the markdown file and the styling file.
Any solutions would be appreciated <3
That's because you are using images.
In markdown the syntax
![x](y)
will be rendered to html as
<img src='y' alt='x'>
So, the solution is either using plain emoji as #ando-andriamalala suggested.
Or, if you really need to use image (I'm guessing for display consistency?), you can, assuming you only use this domain for your emoji needs:
.Content img[src*="https://static.xx.fbcdn.net"] {
...
}
see MDN CSS: Attribute selectors for details
Try to use copy and past emoji instead of image 😆
here a link https://getemoji.com/

Generate content code from Icon s pack - CSS

I have downloaded a simple template from the internet and for icons, the developer used Flaticons font. Now I want to put another icon on the website but I can't get Flaticons code for CSS file. On Flaticon site only can be downloaded in PSD, SVG, BASE 64 I don't have code like .flaticon-research:before { content: "\f100"; }. How to get that? Is there any solution to convert SVG file to get that content or how? I don't want to download every single SVG file and from the SVG file get the icon. I want to use the above example method. Any help will be welcome. Thanks all
follow the instruction here https://www.flaticon.com/iconfonts
after downloading the font you will see multiple files show you how to use your icons depending on you using css or scss

How to map the icons from the CSS file?

I downloaded a free css theme and this theme uses css file and font files for icons and unfortunately the theme has no documentation. How can I visually export them to an html file instead of looking at the CSS file line by line?
https://yadi.sk/d/K1fgjd61wWCy8Q
https://yadi.sk/d/j3tjDtwa3Gucng
https://yadi.sk/d/QCi26iPmPE5QIA
https://yadi.sk/d/POI-p5eOsmQArQ
https://yadi.sk/d/tKJY9lGomWsqmg
It was obviously created through icomoon, but I want to see visually which icons are there.
Just to clarify, you wanted to have a preview of the icons, right? That's why you're asking to convert it to HTML to easily view in the browser. If so, I hope this would do:
With the use of your .SVG file (https://yadi.sk/d/tKJY9lGomWsqmg), you can upload this to https://icomoon.io/. There, you can have a preview of the available icons with their corresponding names.
IcoMoon App has a feature of converting .SVG to icons. And with that, it also offers to have a preview of the icons with their names.
I tried opening the .SVG on itself, but (I'm not an expert here) I didn't get to have a preview of the icons.
I hope that helps.

How to make a font-icon from PNG image?

At the moment I am using .png images for my icons. I want to convert them to font-icons and use them instead. What I am doing is converting the images to SVG and then importing them in Icomoon, but all I get are blank fields. What am I doing wrong? Are there any requirements that I am missing?
I had the same problem and it is the paths in style.css file you got from Icomoon, correct them and it will be okay.

What is this data css?

Ist this a way to hide picture paths to users?
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPHJhZGlhbEdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjUwJSIgcj0iNzUlIj4KICAgIDxzdG9wIG9mZnNldD0iMCUiIHN0b3AtY29sb3I9IiNjZGEwZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjMzcxNDVjIiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L3JhZGlhbEdyYWRpZW50PgogIDxyZWN0IHg9Ii01MCIgeT0iLTUwIiB3aWR0aD0iMTAxIiBoZWlnaHQ9IjEwMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
This is a base64 encoding of an svg image. There's another StackOverflow answer that explains it in a little detail.
This is actually the svg file in base64. This way you can have pictures or other files in your website without actually uploading them to your webspace.
base64 encoding for images. Using image without placing it anywhere.
Here is how you get this type of code for your image : Base 64 Image Maker

Resources