Downloading narrow page (8.26 x 11.69 in) which is not standard

  1. Hi,

I a I already have Aspose.Slide licence, now trying aspose.pdf for our next requirement. I found something related to page size generated by aspose.pdf.

A Aspose is downloading narrow page (8.26 x 11.69 in) which is not standard. It needs to be 8.50 x 11 in. You can check this in document properties.

A demo file generated from aspose.PDF is attached herewith. Pls have a look and share the solution for this.

Thanks

Hi Sanket,

Thanks for contacting support.

Aspose.Pdf for .NET supports the feature to set dimensions for PDF document. Please try using following code snippet to accomplish your requirements.

[C#]

// Open a document

Document pdfDocument = new Document("c:/pdftest/a6c377fe-0d3c-4df1-9697-5bd840acb33c.pdf");

// Get page collection

PageCollection pageCollection = pdfDocument.Pages;

// Get particular page

Page pdfPage = pageCollection[1];

// Set the page size as A4 (8.50 x 11 in) and in Aspose.Pdf, 1 inch = 72 points

// so dimensions in points will be (612, 792)

pdfPage.SetPageSize(612, 792);

// Save the updated document

pdfDocument.Save(“c:/pdftest/Updated.pdf”);