Hi F. E., hi all,

yes, I think (AFAIK) that the references in the name trees from
the appended doc need to be corrected for the appended-to one.

Best regards, mabri


> "F. E." <exler7...@gmail.com> has written on 9 March 2017 at 15:25:
> 
> I digged into the podofo source code a bit and found that the merging / 
> appending of embedded files informations is not fully implemented yet:
> 
> PdfDocument.cpp, lines 364ff
> 
>     // TODO: merge name trees
>     // ToDictionary -> then iteratate over all keys and add them to the new 
> one
>     return *this;
> 
> The objects are already merged, but not the name trees. I figured that I need 
> to update the values in the "Embedded Files" name tree in order to make the 
> 'hidden' embedded files accessible via the attachment table again. Through 
> much trial-and-error, I achieved that the attachment table is actually 
> listing my 'lost' embedded files:
> 
[code snipped]
> 
> But that's sadly not sufficient :-(. When trying to save the attachment to 
> the filesystem, no file is created.
> I'm guessing that the references to the file stream objects are wrong. The 
> references might still be pointing to some objects originally from the 
> appended pdf, but I would need refs to the objects of the newly copied file 
> streams. Am I right here?
> 
> Frederik
> 
> 2017-03-07 16:41 GMT+01:00 Leonard Rosenthol <lrose...@adobe.com>:
> 
> > OH – I misunderstood your question/point.
> > 
> > You are saying that if you merge/append two documents, that it doesn’t 
> > merge attachments. Yes?  So that if you have a PDF with 1 attachment and 
> > one PDF with 2 attachments and merge them – you get a PDF with 3 
> > attachments. 
> > 
> > In that case, I agree with you that it should do that – and if it doesn’t, 
> > it’s a bug…
> > 
> > Leonard
> > 
> > From:  "F. E." <exler7...@gmail.com>
> >  Date: Tuesday, March 7, 2017 at 9:58 AM
> >  To: Leonard Rosenthol <lrose...@adobe.com>, 
> > "podofo-users@lists.sourceforge.net" <podofo-users@lists.sourceforge.net>
> >  Subject: Re: [Podofo-users] Appending PDF: Embedded files of appended file 
> > not accessible in result pdf
> > 
> > I'd like to disagree there. If the framework gives me a high level option 
> > to append a whole pdf document (which the Append function provides), I'm 
> > expecting that it's doing just that, including the embedded file. On the 
> > contraty, if I iterate over all pages and add each page sequentially, I 
> > wouldn't expect the embedded files to be added as well (does this work?).
> > 
> > Even if we agree that the Append() function should only append the pages of 
> > the given pdf file, there's still the effect that previously existing 
> > embedded files are still hidden in the pdf, but cannot be accessed 
> > (evaluated by looking at file sizes). That's inconsistent if we agreed that 
> > the function only appends pages.
> > 
> > So I think, either something has to be done to make the embedded files 
> > accessible again (where I would need help for) or the embedded files should 
> > be ignored at all when using the Append() function, so the result pdf size 
> > won't increase by the size of the previously existing embedded files.
> > 
> > Frederik
> > 
> > 2017-03-07 14:54 GMT+01:00 Leonard Rosenthol <lrose...@adobe.com>:
> > 
> > > Appending is not the same as Attaching.
> > > 
> > > Appending is what the name implies – append the pages from one to the 
> > > other.  So that a appending a 10 page document to another 10 page 
> > > document yields a document with 20 pages.
> > > 
> > > Attaching is the same as it is with Email or using a ZIP file.  You are 
> > > adding the files “inside of” the primary file – but not as part of the 
> > > content.
> > > 
> > > Leonard
> > > 
> > > From: "F. E." <exler7...@gmail.com>
> > >  Date: Tuesday, March 7, 2017 at 8:44 AM
> > >  To: "podofo-users@lists.sourceforge.net" 
> > > <podofo-users@lists.sourceforge.net>
> > >  Subject: [Podofo-users] Appending PDF: Embedded files of appended file 
> > > not accessible in result pdf
> > > 
> > > Hello dear podofo users,
> > > 
> > > recently I experimented with merging multiple pdf files into one pdf 
> > > using the Append function of PdfDocument. It works like a charm with the 
> > > pdf pages and annotations, but I recognised that attached files (at 
> > > document root) of appended pdfs are not listed in the attachment table of 
> > > my pdf viewer (Foxit 8.0, didn't check other viewers I've got to admit). 
> > > When checking the size of my result pdf, it was clear that the embedded 
> > > files are still there somewhere, but I cannot access them it seems.
> > > 
> > > Is this the expected behaviour or did I stumble over a bug / missing 
> > > feature here? I think there might be a way to recreate the necessary 
> > > internal references, but I'm lacking the knowledge to do so. I could 
> > > circumvent this issue by manually extracting the embedded files (I know 
> > > how to do that) and adding them to the result pdf (trivial via AttachFile 
> > > function), but I don't know how to remove the embeeded files before 
> > > appending the pdf file.
> > > 
> > > Thanks in advance,
> > > 
> > > Frederik
> > > 
> > >  
> > 
> >  
> 
> ------------------------------------------------------------------------------
> Announcing the Oxford Dictionaries API! The API offers world-renowned
> dictionary content that is easy and intuitive to access. Sign up for an
> account today to start using our lexical data to power your apps and
> projects. Get started today and enter our developer competition.
> http://sdm.link/oxford_______________________________________________
> Podofo-users mailing list
> Podofo-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/podofo-users

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to