Posted by a ceTe Software moderator
Hello Padmaja,
You can insert the PDF page to an already existing PDF at desired position and you can make final PDF by skipping a particular page in the already existing PDF document. Please note that you will need to know what page you are want to replace and at what position you would like to place the new PDF page. It is not possible to compare two PDF documents and pages using our DynamicPDF Merger for Java product.
Sample code.
PdfDocument pdf=new PdfDocument("C:/temporary/AllPageElements.pdf");
MergeDocument finalDocument=new MergeDocument();
//The below code appndends the PDF document by leaving the firsrt page.
finalDocument.append(pdf, 2, 5);
//Code to insert the page into finalDocument.
MergeDocument inputPdf=new MergeDocument("C:/temporary/DocumentC.pdf");
Page page=inputPdf.getPages().getPage(0);
finalDocument.getPages().add(0, page);
finalDocument.draw("C:/temporary/Mydocument.pdf");
Thanks,
ceTe Software Support Team.