Delete one page

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for Java (v4)  /  Delete one page

DynamicPDF Merger for Java (v4) Forum

 Aug 29 2007 5:30 PM
Hi

It is also possible to delete one certain page in a PDF File with your library ?
 Aug 30 2007 3:11 AM
Posted by a ceTe Software moderator
Hello,

Yes, it is possible to delete the pages from a PDF document. In order to delete a page from the document you will have to use overloaded MergeDocument constructor which takes the starting page and the number of pages to merge. For e.g. if you have 10 page document and you want to remove page number 5, please look at the code below:

     PdfDocument pdf = new PdfDocument("filePath/DocumentA.pdf");
     MergeDocument document = new MergeDocument( pdf, 1, 4 );
     document.append(pdf, 6, 5);
     document.draw( "C:/temp/HelloWorld.pdf" );

Thanks,
ceTe Software Support Team.

All times are US Eastern Standard time. The time now is 4:10 PM.