PDF AutoCropPage Method
Posted: Fri May 13, 2022 3:36 pm
Hi, I am looking for some help on the AutoCropPage Method, as I cannot seem to get it to crop at all.
I have tried many inputs for the margin Parameters without any luck.
The files I am processing have clear black borders on 3-4 sides, and crop quite easily using the CropBlackBorders.
I need to crop the pages as PDF pages as they are already OCR'd, and bring them out to GDPictureImaging would require re-OCRing.
Sample
I have tried many inputs for the margin Parameters without any luck.
The files I am processing have clear black borders on 3-4 sides, and crop quite easily using the CropBlackBorders.
I need to crop the pages as PDF pages as they are already OCR'd, and bring them out to GDPictureImaging would require re-OCRing.
Sample
Code: Select all
Dim GDpdf As New GdPicturePDF
GDpdf.NewPDF()
Dim message As String = ""
Dim status As GdPictureStatus = GDpdf.LoadFromFile(Filename, True)
If status = GdPictureStatus.OK Then
Dim pageCount As Integer = GDpdf.GetPageCount()
status = GDpdf.GetStat()
Dim pageNo As Integer = 1
While (pageNo <= pageCount) AndAlso (status = GdPictureStatus.OK)
GDpdf.SelectPage(pageNo)
If status = GdPictureStatus.OK Then
GDpdf.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitInch)
status = GDpdf.AutoCropPage(0.25, 0.25, 0.25, 0.25)
status = GDpdf.GetStat()
'End If
End If
pageNo += 1
End While