PdfCopy doesn't allow new content.

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Giovanni Meazza
> Sent: Wednesday, February 28, 2007 7:49 AM
> To: [email protected]
> Subject: [iText-questions] PdfDestination with PdfStamper
> 
> Hi, i'm pretty new to java and mostly to itext, so excuse if 
> my question is obvious for you, but i need to add destination 
> to a pdf created with pdfstamper;
> this is my code, (taken from internet, maybe from your site)
> 
>             document = new Document();
>             copy = new PdfCopy(document, new 
> FileOutputStream("newPdfFromTemplate.pdf"))
>            document.open();
>             //
>             // Acquisizione Moduli del Pdf Iniziale
>             //
>             reader = new PdfReader("Template.pdf");
>             baos = new ByteArrayOutputStream();
>             stamper = new PdfStamper(reader, baos);
>             form = stamper.getAcroFields();
>             //
>             // Impostazione Primo Valore Letto
>             //
>             form.setField("FIELD", "DATA");
>                     stamper.setFormFlattening(true);
>                     stamper.close();       
>                     //
>                     reader = new PdfReader(baos.toByteArray());
>                     copy.addPage(copy.getImportedPage(reader, 1));  
> // 
> I tried to add
>                 PdfContentByte under;
>                 under = stamper.getWriter().getDirectContent();
>                 PdfDestination  de   = new 
> PdfDestination(PdfDestination.FITR, 0, 0, 0, 0);
>                 PdfOutline level1 = new 
> PdfOutline(under.getRootOutline(), de, "test");
> in several ways, but i always get null pointer exception.
> Someone could Help me?
> Thanks
> 
> -- 
> 
> 
> Giovanni Meazza
> 
> _________________________________________________________________
> 
>  
> 
> europeconsulting 
> <C:%5CDocuments%20and%20Settings%5Cgiovanni%5CDocumenti%5Cform
> at%20mail%5CFirma%5Cslide0001_image003.jpg> 
> 
> Europe Consulting S.r.l.
> 
> Corso L. da Vinci, 48
> 
> 21013 Gallarate (VA)
> 
> http://www.europeconsulting.net <http://www.europeconsulting.net/>  
> 
>  
> 
> Tel.  + 39 0331 245811  -  Fax:   + 39 0331 1986857
> 
> Cell.. + 39 338 2590558  
> 
> Email:  [EMAIL PROTECTED]
> 
> Skype:    meazzagiovanni
> 
> ________________________________________________________________
> 
>  Il testo e gli eventuali documenti trasmessi contengono 
> informazioni riservate al destinatario indicato. Questa 
> e-mail è confidenziale e la sua riservatezza è tutelata 
> legalmente dalla legge 196/2003. 
> La lettura, copia od altro uso non autorizzato o qualsiasi 
> altra azione derivante dalla conoscenza di queste 
> informazioni sono rigorosamente vietate. Qualora abbiate 
> ricevuto questo documento per errore siete cortesemente 
> pregati di darne immediata comunicazione al mittente ai 
> numeri indicati e provvedere immediatamente alla sua distruzione 
> 
> 


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to