Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#5 Advanced PDF Merging

Andreas Pinter

This patch extends the current PageManager.Add funtionality in such a way, that all the destinations are merged as well. More importantly it tries to solve the problem with circular references and therefore allows links in both PDFs to stay functional and valid during the merging process.

The main Idea is to allocated new objectIDs as soon as they are needed, but "fill" them as soon as they are finished. This way other objects can easily reference to this already allocated objectIDs.


<< < 1 2 (Page 2 of 2)
  • Andreas Pinter
    Andreas Pinter

    Unfortunately I'm still not totally happy.
    See the attached c# source to see how I am using the merging. When using alice.pdf as "file1" and open_source.pdf as "file2" the "Introduction" Link from open_source.pdf is working just fine in the result, but Acrobat Pro 9 does not seem to find any named destinations to display in its list. Although the "Introduction" destination is present in the pdf-source (see result.pdf).

    Another little issue (which may be my own problem): when including a pdf with named destination links to named destinations which are not present (yet) the cloner throws an exception and aborts the whole process. A more resilient approach would be better in my opinion.

    -- Andreas

    Last edit: Andreas Pinter 2013-03-05
  • Here we are: the latest commit (rev 108 [1]) should fix the residual issues.

    please let me know, thanks!


  • Andreas Pinter
    Andreas Pinter

    Works fine, thanks.

    A last note:
    If there is a named destination "foo" in both pdfs one set of links* to "foo" is semantically broken after the merge, because their original foo is not the same any more.
    But I guess that's a problem I need to take care prior to merging the pdfs. Especially because some destination names have additional meaning for me and can't be simply replaced by some hash value.

    • I can't really say that the "inserted links" are the broken once, since I also have an example where the original links get changed to point to the destination newly inserted.

    Anyway keep up the good work, it's a pleasure to work with the clown so far!
    -- Andreas

    Last edit: Andreas Pinter 2013-03-11
<< < 1 2 (Page 2 of 2)