mangoo4j wrote:
> I'm trying to load a single page of a pdf document that is available as
> byte[]. Following I want to add some extra content (text) to the page and
> write it to the filesystem.
> I'm not sure whether I'm on the right track while loading the single page of
> interest using:
> 
> byte[] page = new PdfReader( byte[] ).getPageContent( int pageNr );

Sorry, that's the wrong track.
This is explained in chapter 18 of the book.
With this method you get the content stream
of the page, but NOT its resources: images,
fonts, some graphics state stuff (like
transparency), XObjects, and so on,...

> When i try to add some content to the page[] using PdfContentByte
> (PdfStamper.getOverContet( int i)) I get the following exception while
> creating a new PdfReader-object with the new array.
> 
> java.io.IOException: PDF header signature not found.
> 
> The stream data is useless to me...

Of course it is.

> Any ideas for a better approach?

I'm intrigued to find out how you approach iText.
What on earth made you decide to try doing it the
hard way using getPageContent, instead of following
the simple examples that are in the tutorial???
http://itextdocs.lowagie.com/tutorial/general/copystamp/

I'm starting to thinks there's something very wrong
with the tutorial, because I keep on getting these
questions. If you could tell me WHAT is wrong, I'd
really like to hear it, so that I can change it.

The tutorial is free, and therefore not always very
clear. If you need more info: the book is more accurate
in its description of the functionality involved.

br,
Bruno

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to