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

Free Support Forum - aspose.com

PDF Margin info giving me same values always


I am using Aspose.pdf trial version . PageInfo.Margin always giving me same data for all pdfs .Top and Bottom Margins is always 72 point ,Left and Right Margins is always 90 pt

Hi Jaison,


Thanks for your inquiry. Please note PageInfo object is used for setting margins when creating a new PDF document from scratch. However I am afraid currently Aspose.Pdf does not support to get margins of existing PDF document. We have already logged ticket PDFNEWNET-38385 in our issue tracking system to get margins of Page in existing PDF document. We will notify you as soon as it is resolved.

We are sorry for the inconvenience caused.

Best Regards,

Do we have any other ways on reading the margin of an existing pdf document using aspose.

Hi Jaison,


Thanks for your inquiry. Please check following approach to determine page margins, but the logic gets slow for large documents. However we will keep you updated about resolution progress of above logged issue.


Please feel free to contact us for any further assistance.

Best Regards,

Thank you for the quick reply . White space approach does not seems working for us .

Hi Jaison,


Thanks for the acknowledgement.

Please be patient and wait for the implementation of feature requested earlier so that you can explicitly determine the margin of existing PDF files.

Hi Jaison,


Thanks for your patience. Our product team has investigated the issue and need to know which exact margin value you want to obtain as there are different types of margin of PDF page.


Size of the page (page rectangle) could be obtained using Page.Rect property.
Also, Page.MediaBox, Page.CropBox, Page.TrimBox etc can be obtained.

The media box defines the boundaries of the physical medium on which the page is to be printed. It may include any extended area surrounding the finished page for bleed, printing marks, or other such purposes. It may also include areas close to the edges of the medium that cannot be marked because of physical limitations of the output device. Content falling outside this boundary may safely be discarded without affecting the meaning of the PDF file.

The crop box defines the region to which the contents of the page shall be clipped (cropped) when displayed or printed. Unlike the other boxes, the crop box has no defined meaning in terms of physical page geometry or intended use; it merely imposes clipping on the page contents. However, in the absence of additional information (such as imposition instructions specified in a JDF or PJTF job ticket), the crop box determines how the page’s contents shall be positioned on the output medium. The default value is the page’s media box.

The bleed box (PDF 1.3) defines the region to which the contents of the page shall be clipped when output in a production environment. This may include any extra bleed area needed to accommodate the physical limitations of cutting, folding, and trimming equipment. The actual printed page may include printing marks that fall outside the bleed box. The default value is the page’s crop box.

(from PDF specification, 14.11.2Page Boundaries)


We are sorry for the inconvenience caused.


Best Regards,

I am facing the same issue here. Have you implemented this feature? I need to get the document margin from an existing pdf file.
I have created two files in WORD one with margin 0.5 inch , the other one with 1 inch margin, and saved them as PDF files. but from aspose I aways get 90,90,72,72 for both PDFs.

Hi there,


Thanks for your inquiry. As stated above, PDF document has different boxes with different dimensions, so there are different types of margins in PDF document. Please share your sample PDF document here and confirm which exact margin you want to obtain, so we will guide you accordingly.

Best Regards,