Javascript links to embedded documents in PDF with linux

I have received a PDF file which embeds (hundreds of) documents, which I can access directly using the “Embedded files” function in okular (but I have not found an equivalent in evince):

enter image description here

These documents are linked with specific text elements in the PDF file, using a hyperref, which is convenient to find which spreadsheet corresponds to what… However these links are apparently javascript scripts:

enter image description here

When clicking any of these links in either okular or evince, nothing happens. Right click in evince offers a menu which seems unaware of the existence of a link, in okular it only offers to Follow this link but again nothing happens.

Is there anyway to make these links work in any linux PDF tool, and if not, is there any way to print out the script corresponding to a given link, so that I can identify the corresponding file?

Alternatively, can I bulk-export all embedded documents for automatic processing? (grepping my way to the relevant data…)

Answer

Your best bet is probably extracting the embedded files and then using something like a web browser which knows how to handle JavaScript links properly.

You can extract embedded files using pdfdetach, which should be available in the poppler-utils package in your system.

Attribution
Source : Link , Question Author : Joce , Answer Author : theJack

Leave a Comment