Viewing PDF in Obsidian opens save window (JS gets automatically executed?)

What I’m trying to do

I’m am currently migrating my TTRPG files from OneDrive to Obsidian. While recreating some pages I noticed that when i leave a page where I have the character sheets of my players embedded, a dialoge opens where i can save that same file. I don’t even have to click into the embedded viewer, just opening the page and leaving again triggers that dialogue.
The same goes for opening the PDF file itself in obsidian.
I also noticed that scrolling in the PDF viewer is pretty slow and laggy sometimes.

Both those problem do not happen on other PDF files. I suspect that some of the embedded JS is the problem here. There is a lot of logic in that PDF file which might cause the lag while viewing it as well. I can’t remove all that code though since my players need it for their stat sheets.
Since that JS changes a lot of elements in that PDF (filling textboxes, displaying buttons, calculating stats, …) I think some of that code might change the PDF contents while viewing it and Obsidian wants to save those changes.

I have uploaded that recording and that same PDF to my cloud. SInce I’m not allowed to include URLs in my report I’ll add it as a comment. Hopefully… :smiley:

I am using the Desktop Client (v1.8.10) on Windows 11. My hardware is good enough that it should be able to handle a PDF file, even one as mighty as this one with all its JS :smiley:
I was not able to test this on any other platform, so I can’t say if it’s specific to Windows or not.

Things I have tried

  • Opening other PDF files without all that JS code: works fine, no lag spikes or weird dialogues opening
  • Disabling extensions: doesn’t work
  • Opening PDFs in the embedded view and opening them directly in obsidian: same problem in both cases
  • Updating Obsidian: I already had the most recent version

My Request

This ticket is a feature request and a bug report in one but i’d love to be able to disable JS completly in the Obsidian PDF Viewer. It doesn’t matter if some of that JS code is at fault here but i’d like to be able to disable JS parsing to reduce the load on Obsidian, reduce loading times, minimize overhead and to make sure no malicious code can be run without my permission.
If JS ia actually run automatically each time the file is opened that would seem like a huge security risk. Even Adobe prompts the user if he wants to execute unknown code.

If JS is not run automatically i’d wish for.. whatever is causing this problem to be fixed :smiley:
As things are right now i can’t use Obsidian the way i need it to and that actually kinda sucks. I like it way better than OneNote and i’d like to keep using it.

Thanks everyone!

Here is the download link: https :// drive . proton . me/ urls/ G1TEMT0YD4#GpmSCE5YD5DH

Obsidian doesn’t run javascript code present in PDFs.

The same effect of asking to save the file happened on my windows pdf reader.

There is something that trigger the PDF viewers to think that this PDF was edited (the fillable parts).

We believe this PDF is malformed/out of spec/we don’t support whater this PDF is doing. Sorry!

Oh wow, you are right.
I tried a newer version of the same character sheet and that Popup appears in Acrobat on the old version but not the newer one.

Welp, sorry for this report then. It’s time to manually copy all information over to the newer one it seems… Yay… :sweat_smile:
But thank you very much for testing and the explanation!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.