We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Convert Pdf to Image then crop

Hi CropExample.pdf (32.7 KB)
cropped.png (1.5 KB)
uncropped.png (1.4 KB)

Attached is a pdf (cropExanmple.pdf) which I want to create image from. I have done this easily enough using aspose pdf but is it possible to crop the image so it only shows the relevant part of the document. For example I get an output like uncropped.png where I would like an output like cropped.png.

I know pdfs are coordinates based so I am hoping there is some code that gets the x,y coordinates of the lowest element then I can crop the image?


You can determine and trim white-space from the top, left, right and bottom sides of the PDF document by setting CropBox. Please refer to this help topic: Trim White-space Around a Page