Closed benoitkugler closed 4 years ago
Thanks, @benoitkugler! This is a great feature but I encounter problems in my environment (Chrome OS) when viewing the example files. The first is likely a limitation of the Chrome native viewer: I can open the file but have no access to the embedded files. Is there a way to provide an interactive link like a bookmark to them?
The Chrome viewer fails to load the file annotations document and reports the rather unhelpful error Failed to load PDF document.
. Any insights?
Indeed I have the same error on Chromium Web Browser. I will look for the issue and be back when fixed :)
So... I fixed a mistake (due to a bad usage of p.pages and p.newobj()), which means annotations shouldn't cause an error anymore. However, it seams that Chromium is unable to render file annotations... In comparison, Mozilla PDF.js, Okular or Evince (on linux) render the file properly. So it seems it's more a reader issue, but it maybe requires more tests ?
Is there a way to provide an interactive link like a bookmark to them?
Well, file annotations are precisely supposed to offer a "pointer on hover" linking to the file...
Nice work, @benoitkugler! Thanks for the new feature.
Hi, This PR adds support for embedded files, both at the root level via
SetAttachments()
or as page annotations viaAddAttachmentAnnotation()
.Summary of the changes :
Attachment
is added as an API convenience, and two internals slices are added (attachments
andpageAttachments
).Best, BK