pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Smith <brian.smith.h...@statefarm.com>
Subject merging dynamic pdf files
Date Thu, 23 Aug 2012 17:50:14 GMT
Hello. I'm trying to merge two pdf files. The files are dynamic forms that have been generated
for me. I just need to merge them into one pdf file to print. The files merge ok but some
of the data is missing from them after the merge. Here's the code I'm using.

        PDFMergerUtility pdfMergerUtil = new PDFMergerUtility();
                PDDocument outputDocument = new PDDocument();
            PDDocument pdfReader = null;

                pdfReader = PDDocument.load("a ByteArrayInputStream with the byte array of
the first pdf document");
            pdfMergerUtil.appendDocument(outputDocument, pdfReader);
                pdfReader = PDDocument.load("a ByteArrayInputStream with the byte array of
the second pdf document");
            pdfMergerUtil.appendDocument(outputDocument, pdfReader);

            outputDocument.save(outputStream);
            outputDocument.close();

Is this a known problem? Are there any workarounds or solutions to this? Thanks,

        Brian


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message