Resizing PDF Pages |
PdfResizeManager places the pages of an existing PDF document on pages of another size, orientation and margins - for example an A4 document on US Letter - scaling and aligning the content. Links, bookmarks, form fields, attachments and the document information go with the pages.
using ExpertPdf.Anywhere.PdfDocument; using ExpertPdf.Anywhere.PDFResize; PdfResizeManager resizer = new PdfResizeManager(); resizer.Load("report-a4.pdf"); resizer.PageSize = PageSize.Letter; resizer.PageOrientation = ExpertPdf.Anywhere.HtmlToPdf.PDFPageOrientation.Portrait; resizer.PageMargins = new Margins(36); resizer.AllowScale = true; resizer.KeepAspectRatio = true; resizer.HorizontalAlign = HorizontalAlign.Center; resizer.VerticalAlign = VerticalAlign.Top; resizer.Save("report-letter.pdf"); resizer.Close();
KeepOriginalPageSettings keeps the size, orientation and rotation of each page and only applies the margins.
StartPosition and ContentSize set the position and size of the content on the new page.
ViewerPreferences and Security start as the document's own and can be changed.
A PDF/A, PDF/UA or PDF/X document is resized into a document of the same standard.