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

Free Support Forum - aspose.com

Wrong pageinfo.height value

Hi,
when opening attached pdf in Acrobat or Foxit, page size is 656,2x927,8 mm, but when opening the same document with aspose.pdf, pageinfo.height and width are 842x595 what is obviously wrong…
(842*0,35278=297mm)
ent_1004620.pdf (50.4 KB)
Any ideas anybody?
tnx

@ivoradja

Thank you for contacting support.

Please try using below code snippet in order to retrieve correct Width and Height of page. Please note that the basic measuring unit in Aspose.PDF for .NET is point, where 1 inch = 72 points and 1 cm = 1/2.54 inch = 0.3937 inch = 28.3 points.

Document doc = new Document(dataDir + "ent_1004620.pdf");
foreach (Aspose.Pdf.Page page in doc.Pages)
{
    Console.WriteLine("Width: " + (page.Rect.Width / 72));
    Console.WriteLine("Height: " + (page.Rect.Height / 72));
}

We hope this will be helpful. Please feel free to contact us if you need any further assistance.