Done.

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of dayvidpow
> Sent: Tuesday, July 10, 2007 12:39 PM
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] How to use bookmark xml and 
> new PDF documents
> 
> 
> Hi Paulo,
> Thanks for your example below, it works perfect. However, 
> wouldn't it be
> nice if a setOutlines(List) method is added to the PdfWriter 
> class similar
> to PdfStamper.setOutlines(List)? . Just a suggestion.
> 
> Regards,
> David
> 
> 
> Paulo Soares wrote:
> > 
> > Here's an example in C# but you'll get the idea.
> > 
> > ArrayList newBookmarks = new ArrayList();
> > GenerateOutline(newBookmarks, a);
> > PdfDictionary top = new PdfDictionary();
> > PdfIndirectReference topRef = writer.PdfIndirectReference;
> > Object[] kids = SimpleBookmark.IterateOutlines(writer, topRef,
> > newBookmarks, 
> > false);
> > top.Put(PdfName.FIRST, (PdfIndirectReference)kids[0]);
> > top.Put(PdfName.LAST, (PdfIndirectReference)kids[1]);
> > top.Put(PdfName.COUNT, new PdfNumber((int)kids[2]));
> > writer.AddToBody(top, topRef);
> > writer.ExtraCatalog.Put(PdfName.OUTLINES, topRef);
> > 
> > Paulo
> > 
> > ----- Original Message ----- 
> > From: "dayvidpow" <[EMAIL PROTECTED]>
> > To: <itext-questions@lists.sourceforge.net>
> > Sent: Friday, July 06, 2007 4:54 PM
> > Subject: [iText-questions] How to use bookmark xml and new 
> PDF documents
> > 
> > 
> >>
> >> Currently I am using the following to add some bookmarks 
> to an existing 
> >> PDF:
> >>
> >> PdfStamper.setOutlines(SimpleBookmark.importFromXML(new
> >> ByteArrayInputStream(bookmarks.buildXml().getBytes())));
> >>
> >> The above is working just fine, however I need to add the 
> same bookmarks 
> >> to
> >> a new PDF I am creating from scratch using PdfWriter and 
> Document class. 
> >> Is
> >> there a method that allows the setting of bookmarks 
> (outlines) at once on
> >> the PdfWriter or Document in a similar manner ?


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.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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