Have a look at the javadocs for SimpleBookmark. 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Robin Zhao
> Sent: Tuesday, January 10, 2006 6:23 AM
> To: itext-questions@lists.sourceforge.net
> Subject: [iText-questions] 1. Merge PDF and add Bookmark 2. 
> How to merge PDF and Tiff?
> 
> 1. After merge PDF file, i want to add bookmark. For example, 
> Bookmark is 
> file name that been merged.
> 2. How can i merge PDF and Tiff file into a PDF?
> 
> 
> Follow is my source code, please give me some advise, how to 
> change the 
> code?
> 
> ......
> int pageOffset = 0;
>     ArrayList master = new ArrayList();
>     int f = 0;
>     int count = 0;
>     count = filename.size();
>     Document document = null;
>     PdfCopy  writer = null;
>     for ( f = 0;f < count;f++) {
>         // we create a reader for a certain document
>         PdfReader reader = new PdfReader((String)(filename.get(f)));
>         reader.consolidateNamedDestinations();
>         // we retrieve the total number of pages
>         int n = reader.getNumberOfPages();
>         List bookmarks = SimpleBookmark.getBookmark(reader);
> 
>         if (bookmarks != null) {
>             if (pageOffset != 0)
>                 SimpleBookmark.shiftPageNumbers(bookmarks, 
> pageOffset, 
> null);
>             master.addAll(bookmarks);
>         }
>         pageOffset += n;
> 
>         if (f == 0) {
>             // step 1: creation of a document-object
>             document = new 
> Document(reader.getPageSizeWithRotation(1));
>             // step 2: we create a writer that listens to the document
>             writer = new PdfCopy(document,baos);
>             //writer = new PdfCopy(document, new FileOutputStream
>                            ("c:\\share\\concatenatedforms.pdf"));
>             // step 3: we open the document
>             document.open();
>         }
>         //step 4: we add content
>         PdfImportedPage page;
>         for (int i = 0; i < n; ) {
>             ++i;
>             page = writer.getImportedPage(reader, i);
>             writer.addPage(page);
>         }
>         PRAcroForm form = reader.getAcroForm();
>         if (form != null)
>             writer.copyAcroForm(reader);
>     }
>     //step 5: we close the document
>     document.close();
> ...........
> 
> 
> Regards
> Robin
> 
> _________________________________________________________________
> Keep track of Singapore & Malaysia stock prices. 
> http://www.msn.com.sg/money/
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep 
> through log files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  
> DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to