PDF and PageSize

I am trying to get out the size of an page in an open pdf file, but it seems not to work.


Aspose.Pdf.Document pdfdoc = new Aspose.Pdf.Document(@fileName);
if (Aspose.Pdf.Facades.PageSize.A4.IsLandscap)
{
//Do someting…
}
Maybe i am doing it wrong, but i have tested it with different document and it delivers the same result
every time ???

Hi Toivo,

Thanks for using our products and sorry for the delay in response.

Kindly visit the following documentation link for details and code snippets as per your requirement.

Changing page sizes in a PDF file

Please feel free to contact support in case you need any further assistance.

Thanks & Regards,

Hi Toivo,


Thanks for using our products.

Rashid has shared the link to change the page size in existing PDF document, however if your requirement is specific to getting current page size/dimensions, please visit the following link for required information on Get Page Properties

As a future reference for those looking at the different page dimension properties available in the pdf spec, I found this to be useful:


http://www.prepressure.com/pdf/basics/page-boxes

Hi Dan,


Thanks for sharing the useful information. It will definitely help in understanding different page dimensions supported by PDF file.