pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Huber, Michael" <Michael.Hu...@bayernlb.de>
Subject PDFMergerUtility produces Garbage
Date Wed, 06 Feb 2013 10:31:11 GMT
Hello all,

i'am using the PDFMergerUtility to merge a bunch of pdf files created by graphviz into one
pdf. The pdf files created by graphviz are readable by acrobat reader X.

Problem:
The merged output pdf is fine when run under Eclipse Juno SR1, Java 1.6 runtime.
The output is garbage when run from executable jar from windows cmd line.

Any Idea?

Thanks in advance,

Michael

Java code:
The Vector "images" simply contains a list of fqdn to pdf files created by graphviz

      public void addToMainPdf(Vector<String> images) throws COSVisitorException, IOException
{

            File mpdf = new File(mainPdfFile);
            mpdf.delete();

            PDFMergerUtility pdfMergerUtility = new PDFMergerUtility();
            pdfMergerUtility.setDestinationFileName(mainPdfFile);
            log.info("Erzeuge pdf " + mainPdfFile);

            for (String imagePdf : images) {
                  log.info("Lade Seite: " + imagePdf);
                  pdfMergerUtility.addSource(imagePdf);
            }
            pdfMergerUtility.mergeDocuments();
            log.info("pdf wurde erzeugt: " + mainPdfFile);
      }


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