How to automatically crop the white/black edge of pdf

Hi, Support:

Is there any method to crop the white/black edge of pdf based on VB.net and aspose.pdf.dll?

Thanks for your help!

Ducaisoft

@ducaisoft

Thank you for contacting support.

Would you please elaborate your requirements while sharing source document and screenshots of expected output so that we may investigate further and assist accordingly.

please refer to the attachments for input and output.
Another question is that:
The size of each cropped pdf page may be not same after its blank black/white edge was cropped, I want to reset the size of each cropped pdf page to A4 page size, and place the cropped page in center. How to achieve this?
And the pdf.dll can recognize the boundary of the content in the pdf page precisely?
Thanks.
InputFile(with white blank edge in each page).pdf (694.5 KB)
OutFile(white blank edge in each page have been automatically cropped).pdf (693.1 KB)

@ducaisoft

The source document appears like OCRed document which is holding a whole page size image so when we try to Get Page Properties, same values are extractd for all page properties like Bleed Box, Art Box etc. So we are afaid such PDF documents can not be cropped automatically.

Hi, Support:

Has the feature been available in the lastest version?

Please refer to the demo files.

Input.pdf (96.8 KB)

Output.pdf (648.6 KB)

@ducaisoft

We have checked your recently shared files. Do you want to crop the PDF page to the present image boundaries?

Yes! But It should be auto-done.

@ducaisoft

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-55731

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.