Is there any way, I can convert HTML Document (file not URL) to Image, or PDF to image?
I am able to do the above using Ghostscript DLL , Is there any other way , I can do it, without using the Ghostscript DLL?
I am developing a C# Windows Application.
Use LibPdf, for PDF to Image conversion
Usage example:
ImageMagick, you should also look at this freely available and powerful tool. It's capable of doing what you want and also provides some .NET bindings (as well as bindings to several other languages).
In its simplest form, it's just like writing a command
You can use below any one library for PDF to Image conversion
Use Aspose.pdf link below: http://www.aspose.com/docs/display/pdfnet/Convert+all+PDF+pages+to+JPEG+Images
code sample:
Use Bytescout PDF Renderer link below: http://bytescout.com/products/developer/pdfrenderersdk/convert-pdf-to-png-basic-examples
code sample :
In case someone wants to use Ghostscript.NET.
Ghostscript.NET - (written in C#) is the most completed managed wrapper library around the Ghostscript library (32-bit & 64-bit), an interpreter for the PostScript language, PDF.
It is dependent on executable file you have to install on your machine. Here is a link from where you can see and download the latest version of the exe.
P.S. I had some troubles with the latest version 9.50 not being able to count the pages.
I prefer using the 9.26 version.
Next step is to find and install Ghostscript.NET from Nuget. I download the PDF from CDN url and use the MemoryStream to open and process the PDF file. Here is a sample code:
You can also use it with temporary FileStream. Here is another example. Note that the File is temporary and has DeleteOnClose mark.
Hope it will help someone struggling to get high quality images from pdf for free.