After converting a PDF document to a graphic file, the crop results were not what I had expected. Why does the image have so much white space around the margins?
With PDF2IMG you can use the pdfregion command line statement or the pdf2img_set_output_region API to draw a boundary around a page or part of a page of a PDF input document, and then rasterize that content to a graphic export file. You can select from six different region values to define the amount of white space in the margin of the export file.
Adobe Acrobat offers a similar option to remove white space around a page. Select Print Production, and then Set Page Boxes.
Click the box for Remove White Margins to reduce the margins.
With PDF2IMG, you would choose the “Bounding” region value for the command line statement or “BOUNDINGbox” region value for the API to draw the smallest possible box around the content on the original PDF page. The bounding box, however, cannot be guaranteed to leave no white space around the text or graphic content in the output file. Sometimes the bounding area can include objects that fall outside of the borders of the PDF page, such as a wide Bezier curve, where the control point for the curve is far away from the page itself.