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.

Close

#5 Advanced PDF Merging

closed-fixed
nobody
None
5
2013-03-08
2012-07-30
Andreas Pinter
No

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.

Discussion

1 2 > >> (Page 1 of 2)
  • Andreas Pinter
    Andreas Pinter
    2012-08-14

    Advanced Merging Patch - including Bugfix

     
  • Andreas Pinter
    Andreas Pinter
    2012-08-14

    I have found a bug with /GoTo actions referencing pages.

     
    • status: open --> closed-fixed
     
  • Andreas Pinter
    Andreas Pinter
    2013-02-25

    Hi Stefano,

    the cloning of annotations and links seem to work just fine.
    But I saw that you didn't include my function for copying NamedDestinations in the PageManager.Add() functions. Is there another way (I havn't found yet) to copy those destinations because all the links are rather useless if the destination is not copied as well.

    Nevertheless, thanks for fixing that circular reference issue (in a much more elegant way than I did)

     
  • Andreas Pinter
    Andreas Pinter
    2013-03-04

    Hi Stefano,

    I hate to bother you again, but I can't get it to work.
    As far as I understand your solution you are now simply cloning each page and recursivly cloning everything inside it using the "Cloner". Since none of the objects (like LocalDestination) have a .clone method any more, its rather hard to debug and find out if a LocalDestination is actually cloned or not. When a link like << Type Action S GoTo D (Ne76e096b) >> should be copied to the target pdf it is indeed copied with a new object id but unfortunately 'Ne76e096b' does not show up in the /Names section of the pdf.

    May this be, because named destinations are siblings of pages (hierarchically speaking) and not children?

     
  • Hi Andreas,
    to definitely solve this issue, the best thing would be if you could send me a PDF to test your assertion.

    I'm looking forward to your sample, thank you!
    Stefano

     
  • Andreas Pinter
    Andreas Pinter
    2013-03-04

    Hi Stefano,

    attached are two example pdfs and the resulting file.
    I changed the "open_source.pdf" in such a way, that the "Introduction" link on the first page is using a named destination.

    The merging was done by opening "alice.pdf" with a PageManager and calling manager.add(3, "open_source.pdf"); I know that this is not totally correct, but I guess I can spare you the details how to open the files etc.

    I save the resulting file using orig.Save("path", StandardMode);

    As you can see the "result.pdf" does not have any named destinations.

    Hope this helps

     
    Attachments
  • my fault! I overlooked that Cloner.ActionFilter missed to be attached...

    Now, rev 106 [1] should be fine.
    Stefano

    [1] https://sourceforge.net/p/clown/code/106/

     
1 2 > >> (Page 1 of 2)