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

Free Support Forum - aspose.com

PDF pageSize

PdfPageEditor pEdit = new PdfPageEditor();

// Bind pdf file
pEdit.BindPdf(dataDir + @"" + name + ext);

Aspose.Pdf.PageSize pageSize = pEdit.PageSize;
pageSize.Width ==> -1 , pageSize.Height ===> -1

My question is:
I wanted to have a page size for a certain PDF, but what I got was -1 for each pageSize.Width and Height.

Is there anything I missed? Or I did wrong?

Thanks,

@hbhur102,

Kindly send us your source PDF document. We will investigate your scenario in our environment, and share our findings with you.

Thanks

This is my PDF document…

FilledForm-8.pdf (684.8 KB)

@hbhur102,

We have tested your source PDF document with the latest version 18.4 of Aspose.PDF for .NET API, and can retrieve the page size with the page index as follows:
C#

string dataDir = @"C:\Pdf\test801\";
Document document = new Document(dataDir + "FilledForm-8.pdf");
double height = document.Pages[1].GetPageRect(false).Height;
double width = document.Pages[1].GetPageRect(false).Width;