Sumatrapdf: Support clickable region

Created on 3 Sep 2019  ·  8Comments  ·  Source: sumatrapdfreader/sumatrapdf

What do I mean by clickable region?

After searching a while, I can't find the official name for this pdf feature.
Nevertheless, here's a gif illustrating it with a side by side comparison.

Left pane: Correct behaviour (PDF XChange)
Right pane: Sumatra

Note that only left-click is used in this video.

As you can see there's a clickable "metadata" region on top of the U15 rectangle, that is not accessible with sumatra pdf.

Additional info

| name | info |
| -- | -- |
| OS Name | Microsoft Windows 10 Pro |
| OS Version | 10.0.18362 N/A Build 18362 |
| SumatraPDF Version | v3.1.2 x64 |

The pdf was created with Altium Designer.

Footer

Thanks for your great work.
Feel free to ask me questions

mupdf

Most helpful comment

Looking at the sample file with a text editor (after running mutool clean -d to decompress streams), with the help of the PDF 1.7 reference, it seems the clickable regions are links that cover the rectangles of the pieces (like the U4), and which preform a JavaScript action (as opposed to the usual go to page/URI actions) when clicked. In this file, the JavaScript action calls app.popUpMenu() (see p. 136-7 of the JavaScript for Acrobat API Reference) to display the metadata in a popup [menu] window.

From what I can see, MuPDF currently doesn't support JavaScript link actions, nor the JavaScript app.popUpMenu() function. Also, event callbacks would need to be implemented, so the viewer app can display the popup window when app.popUpMenu() is called.

All 8 comments

It would be nice if you could also attach a sample PDF for any devs to look at.

It would be nice if you could also attach a sample PDF for any devs to look at.

Sadly, I'm not in a position to share this specific pdf.
I will look if i can find one with the same propriety, but without sensible information.

Here's a pdf sample.
You should be able to click on U4, on the first page.

Before
Click here !

After
After clicking

Feel free to ask me any questions.

The latest versions of Firefox, Edge and MuPDF (Sumatra's PDF engine) do not seem to support these clickable regions.

Since Adobe's is the reference implementation, can you check whether the regions work in Adobe Reader?

I did the following test:

Support for clickable region tests:
✅ Adobe Reader
✅ PDF XChange
❌ MuPDF
❌ SumatraPDF

Thanks, so now it's up to the Sumatra and MuPDF devs to figure out what these clickable regions are, and for the latter to add support for the same.

If you want to speed up the process you can file a bug report directly for MuPDF here and share the same file with them.

Thanks, so now it's up to the Sumatra and MuPDF devs to figure out what these clickable regions are, and for the latter to add support for the same.

Thanks for your great work.

Looking at the sample file with a text editor (after running mutool clean -d to decompress streams), with the help of the PDF 1.7 reference, it seems the clickable regions are links that cover the rectangles of the pieces (like the U4), and which preform a JavaScript action (as opposed to the usual go to page/URI actions) when clicked. In this file, the JavaScript action calls app.popUpMenu() (see p. 136-7 of the JavaScript for Acrobat API Reference) to display the metadata in a popup [menu] window.

From what I can see, MuPDF currently doesn't support JavaScript link actions, nor the JavaScript app.popUpMenu() function. Also, event callbacks would need to be implemented, so the viewer app can display the popup window when app.popUpMenu() is called.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Aliaksandr3by picture Aliaksandr3by  ·  4Comments

kloked picture kloked  ·  6Comments

StefanSchroeder picture StefanSchroeder  ·  7Comments

Hassenky picture Hassenky  ·  8Comments

zeniko picture zeniko  ·  5Comments