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

Free Support Forum - aspose.com

Properties Page.PageInfo.Width & Height returns wrong values

I have a .pdf document with custom page size 19,69x3,94 in
When I open it using Aspose.Pdf.Document and check page size I receive another values which correspond to a standard A4 page: 595x842 points

Demo project with test document: https://drive.google.com/file/d/0B-CEaN01bFt3cVF5NGNvMnphWUk/view?usp=sharing

@tak

Thanks for contacting support.

Please use following code snippet in order to get correct height and width of the visible area of document in PDF viewer.

Dim doc As New Document(dataDir + "Custom_size.pdf")
Dim pdfpage As Page = doc.Pages(1)
Console.WriteLine((pdfpage.CropBox.Width / 72).ToString("n2"))
Console.WriteLine((pdfpage.CropBox.Height / 72).ToString("n2"))

In case of any further assistance, please feel free to contact us.

Thank you! CropBox.Width & CropBox.Height return exactly what I need.

@tak

Thanks for your feedback.

It is good to know that suggested approach worked for you. Please keep using our API and in case of any further assistance, please feel free to create a new topic and contact us.