One feature of our app lets our customers bundle multiple pdfs into one big pdf output. When we speced out the feature, they wanted a table of contents in the front with bookmarks to each of the sub documents in the whole.
I found a way to do it, but it's pretty high overhead. Because we don't have a sense in advance of how many things might be in the package and how long the Table of Contents will be (in terms of pages), I do a
and drop a bookmark with every TK.CopyForm(); (keeping track of the number of pages added in each CopyForm). Then I close that pass and get the results with a TK.BinaryImage();
Then I open a new OpenOutputFile("MEMORY"), write my table of contents with the information I collected in the first pass. Then I
TK.InputByteArray = _firstPass;
to tack on the whole result, so there's a lot of shuffling around.
Is there a best practice to make that kind of leading table of contents type thing more efficient?
Please sign in to leave a comment.