Hi,
Hi Mario,
Hi,
Well, What should be the approach and the code to ensure that at the end, all pages at the end are in A4 portrait format.
Hi Mario,
PdfPageEditor pEdit = new PdfPageEditor();
// Bind pdf file
pEdit.BindPdf(dataDir + “A4A3pages.pdf”);
// Change page size of the selected pages
pEdit.ProcessPages = new int[] { 3 };
// Here we select a member named ‘LETTER’ from the list of members of PageSize class and assign it to PageSize property of the PdfPageEditor class
pEdit.PageSize = PageSize.A4;
pEdit.Rotation = 270;
pEdit.MovePosition(-50, -20);
pEdit.HorizontalAlignment = HorizontalAlignment.Left;
// Save the file
pEdit.Save(dataDir + “ChangePageSizes_out12.pdf”);
Hi,
Hi Mario,
Document doc = new Document(dataDir + “A4A3pages.pdf”);
PdfPageEditor pEdit = new PdfPageEditor();
// Bind pdf file
pEdit.BindPdf(dataDir + “A4A3pages.pdf”);
// Change page size of the selected pages
int total_pages = pEdit.GetPages();
for(int i=1; i <=total_pages; i++)
{
pEdit.ProcessPages = new int[] { i };
// Here we select a member named ‘LETTER’ from the list of members of PageSize class and assign it to PageSize property of the PdfPageEditor class
if (pEdit.GetPageSize(i).IsLandscape)
{
pEdit.PageSize = PageSize.A4;
pEdit.Rotation = 270;
pEdit.Zoom = 0.7f;
}
}
pEdit.HorizontalAlignment = HorizontalAlignment.Left;
// Save the file
pEdit.Save(dataDir + “ChangePageSizes_output.pdf”);
pEdit.Close();