Delete a page

Delete a page

Forum member · Oct 19, 2015
Is it possible to remove a page from a MergeDocument?

Re: Delete a page

Support · Oct 19, 2015
Hello, There is no direct method or property to delete the pages in the MergeDocument object. Here is the code sample that shows how to create a new PDF (from an existing PDF) by adding only the pages that you would like to retain. PdfDocument pdf = new PdfDocument(@"C:\Temp\Input.pdf"); MergeDocument document = new MergeDocument(); //below code appends first page. document.Append(pdf,1, 1); //Below code appends all the page starting from 3 leaving 2nd page. document.Append(pdf,3, pdf.Pages.Count-2); document.Draw(@"C:\Temp\MyDocument.pdf"); Thanks, ceTe Software Support Team.