PdfContentByte not showing when doing a SilentPrint
- From: "Paulo Soares" <psoares (at) consiste.pt>
- Date: Sat, 2 Dec 2006 11:06:37 -0000
I don't see how that can happen. Can you post a link to a PDF?
Paulo
----- Original Message -----
From: "Frank Griffith" <frankg (at) cotse.net>
To: <itext-questions (at) lists.sourceforge.net>
Cc: <frankg (at) cotse.net>
Sent: Friday, December 01, 2006 11:01 PM
Subject: [iText-questions] PdfContentByte not showing when doing a
SilentPrint
> I'm building my PDF by adding individual TIFF pages to the
> PdfContentByte. Then I'm added some text to the PdfContentByte to be
> displayed at the top of each page. It works fine when I open the pdf
> and print it from the menu, but when I use the silent print, the text
> I've added doesn't print.
>
> I'm not sure if I need more sophisticated javascript to be added to
> the document so that Adobe know to print the text I've added. Or if
> I'm handling the PdfContentByte improperly in my code.
>
> Any assistence is greatly appreciated.
>
>
>
>
> Document document = new Document();
>
> PdfWriter writer = PdfWriter.getInstance(document, stream);
>
> document.open();
>
> PdfAction pdfAction= PdfAction.javaScript("this.print(false);", writer);
> writer.addJavaScript(pdfAction);
>
> document.newPage();
>
> PdfContentByte cb = writer.getDirectContent();
>
> image = Image.getInstance(file.toString());
>
> // add the image to the pdf
> if (null != image) cb.addImage(image);
>
> cb.beginText();
> cb.setFontAndSize(bf, fontSize);
> cb.moveText(x, y);
> cb.showText("bla bla bla");
> cb.endText();
>
> document.close();
>
>
>
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> iText-questions (at) lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/