I want to reorder the document pages.
The content of one file has been offset.
My File:
http://www.mediafire.com/file/jrcrrsb82 ... 4.pdf/fileMy codes:
Code:
string filename = "sample5_4.pdf";
PdfDocument outputDocument = new PdfDocument();
XGraphics gfx;
XRect box;
XPdfForm form = XPdfForm.FromFile(filename);
for (form.PageIndex = 0; form.PageIndex < form.PageCount; form.PageIndex+=2)
{
// Add a new page to the output document
PdfPage page = outputDocument.AddPage();
page.Orientation = PageOrientation.Portrait;
page.Width = form.Page.Width;
page.Height = form.Page.Height;
gfx = XGraphics.FromPdfPage(page);
box = new XRect(0, 0, page.Width, page.Height);
gfx.DrawImage(form, box);
}
filename = "sample5_4_result.pdf";
outputDocument.Save(filename);
Process.Start(filename);