Hi all,

I have made a document Pdf using PdfCopy, so I have lost all the bookmarks.
Is there a way to include again those bookmarks? 
I know a PdfStamper can keep all the bookmarks but I have to create a
PdfCopy instead. I just need to re-include the bookmarks.

I have been trying something like this (hum hum) but it doesn't work:

Document document = new Document();
      PdfCopy copy = new PdfCopy(document,new
FileOutputStream(pdfStaticFilename));
      document.open();

      PdfImportedPage page;
      for (int i = 1; i <= reader2.getNumberOfPages(); i++) {
          page = copy.getImportedPage(reader2, i);
          copy.addPage(page);
          PdfContentByte cb = copy.getDirectContent();
          PdfOutline root = cb.getRootOutline();
          cb.addOutline(new PdfOutline(root, new
PdfAction(pdfStaticFilename,i),pdfStaticFilename),pdfStaticFilename);
      }

      PRAcroForm form = reader2.getAcroForm();
      if (form != null) copy.copyAcroForm(reader2);

      document.close();
      copy.close();

Thanks in advance.
Best regards, 

Patrick

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id149&alloc_id�66&op=click
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to