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.
|Published (Last):||12 April 2013|
|PDF File Size:||10.89 Mb|
|ePub File Size:||20.90 Mb|
|Price:||Free* [*Free Regsitration Required]|
I have copied code I located on cfsearching for concatenating pdfs and including any existing bookmarks http: I keep getting the message ‘ java.
How to show PDF bookmarks by iTextPDF? (Java in General forum at Coderanch)
ArrayList cannot be cast to java. I suspect I am not adding my own ‘custom’ 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 existin 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 exiting 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 itest creating some pdf’s from html, then merging all of those plus extra ‘external’ pdfs into 1 all in CF tags. All worked great except for the 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 bpokmarks format, and if I create it similar to how an iText bookmark looks, I can then add it using addAll?
How to merge PDFs and add bookmarks? | iText Developers
I did briefly attempt that in one exieting my many attempts to get this 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 boookmarks use iText directly via CF?
Once again, thank you for your initial help. I was successful today using the DDX example from the coldfusionjedi site you mentioned http: Worked very nicely thank you.
HELP Adding bookmarks to Existing PDF using PdfStamper ?
Correct Answers – 10 points.