Can iTextSharp rasterize/export to JPEG or other image format?

John Bubriski picture John Bubriski · Apr 26, 2010 · Viewed 7.2k times · Source

I need to be able to export PDF's that I am creating to JPEG, so that users can have a screenshot/thumbnail of the end product, which is faster than opening the whole PDF.

I am running this on an ASP.NET website running in Medium Trust in the Rackspace Mosso Cloud.

I have yet to find a library that will either work in Medium trust, or in the case of ABC PDF, which works great locally, wont load in Mosso. Maybe Mosso has a custom trust level?

I know that iTextSharp works on Mosso, but I haven't been able to figure how to "screenshot" a single page of a PDF, or export a page to JPEG. Is there anyone out there who has done this before?

Answer

Marc Climent picture Marc Climent · May 20, 2010

No, iTextSharp does not support rendering PDF to images, knows a lot about PDF internals but anything about presentation.

There are as well many commercial products that can render PDF to several image formats. ABC PDF seems good... but maybe you can find something that works in medium trust.

Other solutions I can think like using Ghostscript or printing with Virtual Image Driver are not available in that environment.