I have a pdf document and I want to be able to convert a certain region of the document to an image. Exactly as it works with PdfDocumentProcessor.CreateBitmap(...) or .CreateTiff(...)
Instead of the full page, I just want a specific area of the page to be exported. I'm familiar with creating a PdfDocumentArea, I'm just not sure how to convert this selected area to an image.
If this isn't currently an available feature, do you have any ideas on how this could be accomplished in a different fashion?
Our Pdf Document Processor does not provide a special API to create an image based on the specified page area. As a workaround, you can create an image from the entire page. Calculate the required area to be represented by an image. You can get the page size using the PdfPage.CropBox property. Note that it is measured in PDF page unit measurement (points - 1/72 of an inch). And, create a new Bitmap object of the required size and draw the required part of the image using the Graphics.DrawImage method as described in the How to cut a part of image in C#.
I have created a small sample that illustrates this approach. You can find it in the attachment.