Alejandro Camarena wrote:
 

>> 1T3XT BVBA wrote: 
>> 
>> Wrap the PdfTemplate inside an image.
>> Add the image with document.add();
>> or wrap the Image inside a Chunk.
>> 
>
>I'm trying something like this:
> 
>In the Servlet class I have the declaration:
> 
>  PdfTemplate attPages;
> 
>In the construction of the document:
>
>  Image imAttCount = Image.getInstance(attPages);
>  document.add (imAttCount);
> 
>in the event handler, onCloseDocument...
> 
>   attPages.beginText();
>   attPages.setFontAndSize(bf, 10);
>   attPages.showText("Attachment 1: " + cntTab);
>   attPages.endText();
>
>cntTab is a variable that I'm using to store the count of pages. The servlet 
>does nothing, or may I say gets frozen, it seems to be processing >something 
>but never ends. What's wrong?


well, I wasn't creating the template in the construction of the document:

 

  PdfContentByte cb = writer.getDirectContent();
  attPages = cb.createTemplate(330, 50);
  Image imAttCount = Image.getInstance(attPages);
  document.add (imAttCount);


That's it... thnx
                                          
_________________________________________________________________
Una nueva experiencia de búsqueda está aquí
http://www.bing.com/?mkt=es-MX&FORM=M006IR&Publ=WLHMTAG&Crea=TEXT_M006IR_Bing_ES_SaveTimeClicks_1X1
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to