I have PDF files that I want to send to smart phones as jpg's, but I want to preserve images, text formatting, etc. I found so开发者_如何学Gome tools for converting PDF's to imagese, but most of these won't render it first to be readable on a smart phone. The one I found that will convert a PDF to an image suitable for a smart phone (eBook to Images) uses character recognition and rewrites the PDF (you lose any images or formatting). Is there a way I can convert a PDF to an image meant to be viewed on a mobile device?
Thanks!You could use Ghostscript, which is available under GPL and works on a wide range of platforms. You could also use MuPDF which again is available GPL and therefore as source. MuPDF also works on a variety of platforms, including some smart phones. I too am part of the development teams for these products.
If you can use Windows box for the file conversion, using Amyuni PDF Creator you can export a PDF file as a jpg image and specify the resolution (in DPI) you want to use for your images.
C# Example:
System.IO.FileStream testfile = new System.IO.FileStream("TestFile.pdf",FileMode.Open,FileAccess.Read,FileShare.Read);
string exportedFile = "JpegExport.jpg";
IacDocument document = new IacDocument( null );
//Open a pdf document
document.Open(testfile,"");
//Export it to Jpeg
//ExportToJPeg(exportedFile, 300 /*resolution*/, 7 /*compression level*/, 1 /*start page*/, 2 /*end page*/);
document.ExportToJPeg(exportedFile, 300, 7, 1, 2);
The main reason for using DPI resolution is that you can have pages with different size inside a single PDF file, specifing the export resolution in DPI preserves the size relation between pages in the resulting images. You can download the trial version and test it with your files to see if it fits for your needs.
Disclaimer: I am part of the development team for this product
Similiar questions in SO:
Rasterize PDF's with font not embedded using GhostScript
PDF to image using Java
Converting PDF to images automatically
Convert PDF to image
Best way to convert pdf files to tiff files
精彩评论