Convert a HTML file to Image in C++ apart from 'wkhtmltoimage' - html

I need to convert a local HTML file to a Jpeg Image in a C++ module. As per our requirement, I cannot use 'wkhtmltoimage'. Hence I need any command line tool or libraries( which can be used in C++ ) that are available for the same.
Any suggestion will be appreciated.

ImageMagick is able to convert HTML to images (by first converting the HTML into PostScript and then to an image), however it's definitely not the best solution. WebKit is really the best tool for the job here. I don't know all the details about your situation, but maybe try linking to WebKit and using it directly instead of invoking wkhtmltoimage?

Related

How to export HTML and CSS code from PSD file using Open Source tools / plugins?

Can anyone know convert PSD files to HTML and CSS code via any open source software's, Plugins or Frameworks are available to convert it...?
Kindly assist me on this.
You need to have at least basic knowledge on using adobe Photoshop.
a. You need to know how to deal with layers so you can extract the website carefully.
b. Use slicing tool. after you carefully slice each part. then you can now press and hold Ctrl+Shift+Alt+s (all at the same time) then choose save
At the bottom option you can see "Format:" choose html and images then save it on your pc.
Second option is
you can convert you psd to html by going to this site.
http://psdtoweb.de/index.php
I personally don't recommend you to use these methods because the codes in html is not good. I recommend you is study bootstrap instead.

grunt SVG to webfont

I'm trying to generate webfont from SVGs using grunt-webfont.
The issue is that I need this task to be valid on windows and linux machines. In order to achieve this I need to use the node engines that doesn’t work with some SVG files.
I would like to know if there is a way to convert my SVGs to a proper SVG format that will be supported by this grunt plugin or alternatively is there a better grunt plugin/s to achieve this
I would like to have a task that will be able to take my SVGs (created in illustrator) and output webfont files (.eot,.svg,.svg,...) and a css file (like icomoon export)
Thanks.
Perhaps your artboard is too small. I recommend checking that you have a 512pt x 512pt artboard for each icon. I stumbled upon this gem (https://www.fourdigits.nl/blog/using-a-webfont-to-display-icons) when the grunt-webfont documentation left me alone in the forest.
All the docs says is that it might not work with some SVG files. You really should try to convert your files first and then ask what to do with the files that don’t work well.

Beautifying HTML with JSP mixed in

Does anyone know of an HTML beautifier that can deal with (or at least ignore) JSP? I've searched high and low... I'm not looking for an HTML validator, just something that can format the file decently (i.e. indentation).
Most good IDE's will let you say which code template to use as default within another file extension.
So i use PHPstorm in which i can say, for example that a *.jsp will use html first and then jsp. This way the page will display and reformat my code with the correct spacings and what not.
Worth looking into which IDE you are using, assuming you're using one :)

How do I convert PDF to HTML programmatically?

Are there any classes, COM objects, command line utilities, or anything else that I can make an API for that can convert a PDF to an HTML document? Obviously the conversion might be a little rough since PDFs can contain a lot more than HTML can describe. I found a utility called pdftohtml on Source Forge, but quite honestly it does a horrible job with the conversion. I don't care if the software is free or commercial, but is there anything out there at all that I can incorporate with my own software to do this sort of conversion at least decently? I know Google's developed their own method of doing this, since you can click "View as HTML" on a PDF attached to an email through Gmail, but I was hoping there was something out available to the public.
Remember, PDF to HTML. I'm NOT worried about HTML to PDF.
well one solution i can think of is to write little program that reads pdf text using library called iText and then generate html files.
well for java based PDF solutions...we dont have a clean way i guess-still.. all solutions are primitive and kind of workarounds... No easy solution for
1. Designing a template of a PDF
2. Then at runtime using java, populate data into this template...either using xml or other datasources...
such a simple requirement and NONE has a good "open-source and free" solution yet !
Eclipse BIRT comes close.. but does not handle Barcode elements ..OOB.
You were looking for pdf2htmlEX (C++), which converts PDF to HTML without losing text or format.
To convert further to semantic HTML, you can process pdf2htmlEX output using my project Transcript (Python). It is however not lossless anymore and works best on documents not deviating too much from conventional visual layout.

Optimizing AS3 SWF files for size?

Are there any tips / best practices / secrets for optimizing the size of AS3 SWF files? In particular, any way to get a breakdown of what is taking up space inside the SWF, like you used to be able to in the old Flash 7/8 days? I'm not using the Flash IDE any more, but now I'm using either Flex Builder or FlashDevelop, so it needs to be something that I can do without the Flash IDE.
If you're interested what in the code is taking up space, you can get that information from the link report. It's not as detailed as what you can get out of the Flash IDE, but it shows the size of each class (uncompressed.)
To create a link report, use the -link-report <filename> flag on mxmlc. It creates an XML file with information about the classes linked into your SWF.
I used the .XSL file described in the link below to clean it up and make it more readable:
http://blog.iconara.net/2007/02/25/visualizing-mxmlcs-link-report/
One tip would be to try Joa Ebert's "Reducer" tool which can greatly reduce the size of any PNG files in your SWF if you used the embed tag.
http://blog.joa-ebert.com/2009/08/08/reducer/
Make sure, you use PNG-8 where it is possible and PNG-24 where you need alpha-channel.
Use pngout tool to optimize them.
And there are some tools that can obfuscate and optimize SWF files.
I'm not sure what can be done with Flex Builder or FlashDevelop but what I always watch out for is font embedding. I take care to embed only the characters which will definately be used in the final swf.
Hi I previously posted this link in a related question about link report analysis (here), I've used this in the past and its quite a nice tool
LinkReportAIR