

Draw the templates onto the pages in the new PDF PdfTemplate template = page.CreateTemplate() Create templates based on the pages in the original PDF Set text layout as one page (if not set the content will not scale to fit page size) PdfTextLayout layout = new PdfTextLayout() PdfPageBase newPage = (PdfPageSize.A1, new PdfMargins(0)) Loop through the pages in the original PDFįoreach(PdfPageBase page in originPdf.Pages) PdfDocument originPdf = new PdfDocument() Namespace ChangePageSizeToStandardPaperSize Save the result file using PdfDocument.SaveToFile() method.

Draw the templates onto the pages in the new PDF file with the specified text layout using PdfTemplate.Draw() method.Create templates based on the pages in the original PDF using PdfPageBase.CreateTemplate() method.Initialize a PdfTextLayout instance and set the text layout as one page through PdfTextLayout.Layout property.Add pages of the desired size to the new PDF file using () method.Loop through the pages in the original PDF.Initialize another PdfDocument instance to create a new PDF file.Initialize a PdfDocument instance and load the original PDF file using PdfDocument.LoadFromFile() method.The following steps show you how to change the page size of a PDF file to a standard paper size: NET supports a variety of standard paper sizes like letter, legal, A0, A1, A2, A3, A4, B0, B1, B2, B3, B4 and many more. This process will preserve text, images, and other elements present in the original PDF file. The way to change the page size of a PDF file is to create a new PDF file and add pages of the desired size to it, then create templates based on the pages in the original PDF file and draw the templates onto the pages in the new PDF file.

Change PDF Page Size to a Standard Paper Size in C# and VB.NET
