You could start adding new entries, but for this example you’ll get the bookmarks from the existing documents. These bookmarks will work correctly for the first. I’ve made a MergeWithOutlines example that concatenates three existing PDFs using PdfCopy (I assume that you already know that part). While doing so, I. I have an existing PDF document which does not contain any bookmarks. I am currently using PdfStamper to manipulate the PDF and insert text.

Author: Yom Akijar
Country: Indonesia
Language: English (Spanish)
Genre: Travel
Published (Last): 22 January 2015
Pages: 72
PDF File Size: 6.36 Mb
ePub File Size: 7.49 Mb
ISBN: 646-4-43748-809-6
Downloads: 87761
Price: Free* [*Free Regsitration Required]
Uploader: Dairisar

I have copied code I located on cfsearching for concatenating pdfs and including any existing bookmarks http: I keep getting the message ‘ java. ArrayList cannot be cast to java. I suspect I am not adding my own itedt bookmarks to the list of existing bookmarks correctly.

I tried changing the list of existing bookmarks from an explicit vector this was how the example was written to an array instead, but still have this issue when I try to close my document. Following is the code I have modified.

I would appreciate any help. I am not a Java programmer and am really struggling to understand how this works and how to make changes to it. That is why the error occurs. Bookmarks are like a structure and can consist of properties like a title, action, url, page numberstyle etcetera. So it is not as simple as appending a string. To see what a bookmark object looks like to CF, dump the “bookmarks” variable right after the isDefined statement:.


The link for the dump syntax is very helpful! I am using CF8 although had looked into CF9 to see if it resolved my issue.

And had found everything I wanted for my process creating some pdf’s from html, then merging all of those plus ho ‘external’ pdfs into 1 all in CF tags. All worked great except for bookmrks ability to add a bookmark to an existing pdf which was not created via CF which did not have one.

Dumb question here, but just to be sure, are you saying that my new bookmark to add needs to be in a structure format, and if I create it similar to how an iText bookmark looks, I can then add it using addAll?

Adding Bookmarks with outline for PDF document : Bookmarks « PDF RTF « Java

I did briefly attempt that in one of my many attempts to get ho to work, but didn’t have success there either, so did not pursue that further. Perhaps I was just missing a few key things? As for the Quick Tip from coldfusionjedi, I had also found that and tried it, but without success.

Are you saying that I should be able to use this DDX code on an existing pdf file which does not have a bookmark and was created from some source other than CF and see that a bookmark gets added? I can certainly do some reading up on how to use DDX.


And that this would be a better method than trying to use iText directly via CF? Once again, thank you for your initial help. I was itect today using the DDX example from the coldfusionjedi site you mentioned http: Worked very nicely thank you.

You don’t have JavaScript enabled. This tool uses JavaScript and much of it will not work correctly without it enabled. Please turn JavaScript back on and reload this page. Please enter a title. You can not post a blank message.

Adding bookmarks (iText 5)

Please type your message and try again. Internally CF stores arrays as Vectors. This content has been marked as final. To see what a bookmark object looks like to CF, dump the “bookmarks” variable right after the isDefined statement: Go to original post.

Correct Answers – 10 points.