Well, I must admit my previous post sounded like that "kitchen example" :-)

***********************************************************************************************
What I want to do is simply to add a image as a background (watermark)
to a PDF document.
***********************************************************************************************
That is a very simple task following the example in
"http://itextdocs.lowagie.com/tutorial/general/copystamp/index.php";, I
have tested it with PDF files and works fine. But I can't make it work
when the PDF source is a String having its content (String that the
browsers show correctly as s PDF document), not a file.

I have the String that I mentioned, with the known structure
"%PDF-1.1....", I receive it in a servlet and I can properly print it
out to the browser just as I would print any other String (using a
PrintWriter java object), and I can see the PDF on screen. But I can't
add to it a background (watermark) image because the only way I found
to construct the PdfReader object is passing myString.getBytes() to
it, and doing it that way, the final PDF document I get is visually
the same (but bigger in size).

I might be trying to do something impossible with iText, I don't know
(but I don't think so). Reading the page 38 of your book, it says

"...PDF header is written, and by default it looks like this:
%PDF-1.4
%âãÏÓ
"
It says that the %âãÏÓ is a commentary to indicate binary content, but
the string I have doesn't include that %âãÏÓ nor anything similar
under the %PDF-1.4 line. And I don't know if that could be a source of
problems.

Thanks to both you for your comments, suggestions and help, and sorry
for being asking so much. If I manage to run my code properly and to
prepare my "duck à l'orange" **:-)**, I will send it to you to comment
the answer (if you want, of course).
Adriano.

> FYI:
> I have read this thread, and honestly:
> I don't have a clue what this is about.
> Translated to kitchen talk, I interpret
> it as "somebody gave me an egg, and now
> I have to prepare duck à l'orange. What
> should I do next?"
> My first answer would be: "Are you sure
> it's a duck egg you've been given?" ;-)
> br,
> Bruno
>

2007/11/16, Bruno Lowagie <[EMAIL PROTECTED]>:
> Adriano Leite Ribero wrote:
> > I need to use that String (which is not encoded) because an external
> > server sends it to me that way. I receive a String with that content,
> > and it is something I can't change.
> >
> > PdfReader creates apparently ok from that string.getBytes() method,
> > but changes don't seem to happen as expected (the new watermarked file
> > size is bigger than the original one, so something is actaully
> > happening).
> >
> > Think that I want to create manually a PDF and I start to write:
> > String myString = "%PDF-1.1\n1 0 obj\n<<\n" + ... + "74879\n%%EOF".
> > //complete PDF structure
> > What should I do next?
>
> FYI:
> I have read this thread, and honestly:
> I don't have a clue what this is about.
> Translated to kitchen talk, I interpret
> it as "somebody gave me an egg, and now
> I have to prepare duck à l'orange. What
> should I do next?"
> My first answer would be: "Are you sure
> it's a duck egg you've been given?" ;-)
> br,
> Bruno
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> 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/
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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