Title: Aspose.PDF Change page size and keep vertically aligned centered
Tags: c#;aspose;aspose.pdf
Question: 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);
Comment: 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 linda51@example.net.

Comment: We have found your topic there and you will surely be assisted accordingly.

Comment: I've added this question to Aspose forum aswell. I am not looking to resize content, mearly move it to be vertically centred



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:08/29/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><aspose><aspose.pdf>', 'Title': 'Aspose.PDF Change page size and keep vertically aligned centered', 'ViewCount': 37, 'id': 73527872, 'user_AboutMe': '<p>Head developer of the IRIS system used for deviation reporting and quality work. Back end developer in C# and front end Javascript with several frameworks.</p>\n', 'user_AccountId': 227070.0, 'user_DisplayName': 'Pochen', 'user_Reputation': 2782.0, 'user_Views': 100.0, 'user_id': 488512.0}}