ShreyJo10
ShreyJo10

Reputation: 27

appendDocument method of PDFBox not working

Following is the chunk of my code:

    PDFMergerUtility mergePdf = new PDFMergerUtility();


    File f1 = new File("D:/out/pdf-sample.pdf");
    File f2 = new File("D:/out/Combined.pdf");

    PDDocument pd1 = PDDocument.load(f1);


    PDDocument pd2 = PDDocument.load(f2);

mergePdf.appendDocument(pd1, pd2);

There is no error on the console; but the content isn't just getting appended.

Upvotes: 1

Views: 1156

Answers (1)

user14288020
user14288020

Reputation: 11

    pd2.close();
    pd1.save(m_Dest);
    pd1.close();

Upvotes: 1

Related Questions