https://bugs.kde.org/show_bug.cgi?id=436870

John Scott <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |CONFIRMED

--- Comment #7 from John Scott <[email protected]> ---
After some research I found at least one libre PDF viewer that does support
this correctly: PDF.js, the JavaScript-based PDF reader that's often integrated
into browser engines like WebKit and also Mozilla Firefox. In some distros you
may be able to find it as a standalone package. Here's approximately how I can
do this on Debian:

• create a filesystem directory for a web server
> cd ${TMPDIR:-/tmp}
> mkdir -p pdfjs-http/
> cd pdfjs-http/
• incorporate the system-wide copy of PDF.js from libjs-pdf
> if ! [ -e ./pdfjs/ ]
> then ln -s /usr/share/javascript/pdf/ ./pdfjs
> fi
• copy a PDF document you'd like to test with into this directory
> curl -O https://johnscott.me/openact.pdf
• start an HTTP server on some random port of choice
> busybox httpd -f -p 8089
• open the PDF.js viewer in a web browser
> xdg-open http://localhost:8089/pdfjs/web/viewer.html?file=%2Fopenact.pdf

Due to HTTP security voodoo, simply opening viewer.html from the filesystem
won't typically work, so that's why BusyBox's tiny HTTP server or some other
helper is needed. When I do this with the example PDF that I've described how
to construct, I see a dialog box saying "Ahoy" when the file is loaded. Note
that OpenAction isn't restricted to JavaScript but can be used for other PDF
actions.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to