Hello all!

I am using the original example from
https://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/PDFMergerExample.java?view=log
and get an End-of-File-Error at the line
pdfMerger.mergeDocuments(MemoryUsageSetting.setupMainMemoryOnly());
in
public InputStream merge(List<InputStream> sources) throws IOException {...}

Snippets of my code are:

List:
    private final List<InputStream> mergedPDF = new ArrayList<InputStream>();
    public List<InputStream> getMergedPDF() {
        return mergedPDF;
    }

Load a pdf:
PDDocument docPer = PDDocument.load(new File("..."));

Adding items to the List in a loop:
getMergedPDF().add(oneDocSerial(docPer));

Compute docPer:
    private InputStream oneDocSerial(PDDocument doc) throws IOException {
        // do something with doc
        PDStream ps = new PDStream(doc);
        InputStream output = ps.createInputStream();
        return output;
    }

Could anybody please tell me what to do...? If possible in a more detailed 
manner, I'm a beginner...

Kind regards from Salzburg, Austria,
Siegfried
-
Siegfried Gstöttner
[email protected]

Reply via email to