Hi Maruan, thanks for he quick answer.
No, didn't solve the Problem. Same picture: Works with Eclipse Juno but not on the cmd line. I'll file a bug and attach same short pdf files to reproduce the error. With kind regards, Michael -----Ursprüngliche Nachricht----- Von: Maruan Sahyoun [mailto:[email protected]] Gesendet: Mittwoch, 6. Februar 2013 17:17 An: [email protected] Betreff: Re: PDFMerger App also produces Garbage Hi, one thing you can test is using the NonSequentialParser for parsing the source files. Unfortunately the PDFMergerUtility doesn't yet allow using that parser. So you would need to take the source and change PDDocument.load to PDDocument.loadNonSeq. Is that an option for you? You may want to raise an issue in Jira ((https://issues.apache.org/jira/browse/PDFBOX) so the issue is not forgotten With kind regards Maruan Sahyoun Am 06.02.2013 um 16:37 schrieb "Huber, Michael" <[email protected]>: > Hi, > > same problem with pdfbox-app PDFMerger cmd line utility. > > Java -version output: > java version "1.6.0_21" > Java(TM) SE Runtime Environment (build 1.6.0_21-b07) > Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode) > > Cmd line used: > java -jar pdfbox-app-1.7.1.jar PDFMerger c:\temp\1.pdf c:\temp\2.pdf > c:\temp\m.pdf > > If You need the files pls let me know. > > THX for help, > > Michael > > > Von: Huber, Michael > Gesendet: Mittwoch, 6. Februar 2013 11:31 > An: '[email protected]' > Betreff: PDFMergerUtility produces Garbage > > 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); > } >

