Using itextsharp, How can I get the thumbnails of Pages and display in a picturebox. there are hundreds of samples on net using iTextsharp but 99% of them are how to create and manipulate PDF not just read PDF.
// pdfFileName is the file Name PdfReader reader = new PdfReader(pdfFileName); for (int i = 1; i <= reader.NumberOfPages; i++) { // I need something like PdfPage here }
Can someone suggest how to do this? I've had a look at the itext docs and can't figure out where to get started and get a PDF Page , I assumed I need PdfImageObject but how to get there.
Get thumbnail of PDF page using csharp
Answers
iText and iTextSharp are PDF generators only unfortunately, and what you are looking for is actually PDF renderer. According to Bruno Lowagie the creator of iText in a recent blog post they have no plan on doing so any time soon, either.
PDF Clown, which is still only in a very early alpha, has a blog post (see point #3) stating that they've got a partial renderer working so I'd recommend looking at that.
Otherwise take a look at these SO posts about converting PDFs to JPGs:
The PdfImageObject object that you were looking at is used to create an "image-like" object that represents a piece of raw PDF content that can be embedded within a PDF but has no methods for creating a raster image such as JPG or BMP so it wouldn't help you.