0

I have a PDF generated by a third party with incorrect dimensions. They need to be both wider and taller. Using the code below to transform into A4, the page becomes the correct dimensions, but the content is placed in the bottom left corner. Is it possible to decide how the previous content is handled on the crop-up? I would like to have it left side but centered vertically.

pdf.Document pdfDocument = new pdf.Document(path);
PageCollection pageCollection = pdfDocument.Pages;
Page pdfPage = pageCollection[1];
pdfPage.SetPageSize(597.6, 842.4);

BeforeAfter

Pochen
  • 2,871
  • 3
  • 22
  • 27
  • 1
    You may need to resize the page content in order to keep the formatting intact. Please try to check the example in this article (https://docs.aspose.com/pdf/net/manipulate-page-properties/#resize-page-contents-of-specific-pages-in-a-pdf-file) and create a topic in official Aspose.PDF support forum(https://forum.aspose.com/c/pdf) in case your issue still does not resolved. We will proceed to assist you accordingly. This is Asad Ali and I work as developer evangelist at Aspose. – Asad Ali Aug 29 '22 at 18:53
  • I've added this question to Aspose forum aswell. I am not looking to resize content, mearly move it to be vertically centred – Pochen Aug 30 '22 at 12:48
  • We have found your topic there and you will surely be assisted accordingly. – Asad Ali Aug 31 '22 at 19:30

0 Answers0