pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Problem with PDFMergerExample()
Date Thu, 28 Jul 2016 16:12:11 GMT
Am 28.07.2016 um 09:16 schrieb Gstöttner Siegfried:
> Hello Tilman!
>
> Thank you for your quick response. Ist is now working fine. Thank you very much.

Btw what you do is a bit of an overkill for a mailing, although the good 
thing is that you have something working so you can impress your boss :-)
The better way to do it is to create a new PDDocument, then add a page 
to it (importPage(), not addPage()) and modify each by adding the address.

Another thing to take care of: if you append your own content stream to 
a page, then use the one with the fifth parameter set to true. This is 
to take care of PDFs where the content stream does not reset the 
graphics at the end.

Tilman
>
>
> Kind regards,
> Siegfried
> -
> Siegfried Gstöttner
> siegfried.gstoettner@sbg.ac.at
>
>
> -----Ursprüngliche Nachricht-----
> Von: Tilman Hausherr [mailto:THausherr@t-online.de]
> Gesendet: Donnerstag, 28. Juli 2016 08:01
> An: users@pdfbox.apache.org
> Betreff: Re: Problem with PDFMergerExample()
>
> Am 28.07.2016 um 07:41 schrieb Gstöttner Siegfried:
>> The "doc" in "oneDocSerial" is the main document originally loaded from a file. Then
an adress is added to this document. Could you please tell me how to convert the result into
avalid InputStream to get your example working?
> Do this:
>
>
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
>
> doc.save(baos);
>
> doc.close(); // possibly much later, depending if doc uses resources from other documents!
>
> ByteArrayInputStream bais = new ByteArrayInputStrea(baos.toByteArray());
>
> bais is now an input stream.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message