Skip to content

Fixed addJS running twice#72

Merged
claird merged 1 commit intoclaird:masterfrom
SnirBroshi:bugfix/addjs-runs-twice
Jun 21, 2020
Merged

Fixed addJS running twice#72
claird merged 1 commit intoclaird:masterfrom
SnirBroshi:bugfix/addjs-runs-twice

Conversation

@SnirBroshi
Copy link
Copy Markdown

Fixes #70

This implements the fix suggested in py-pdf#482 by @youssef-jaber - replacing /OpenAction with /JavaScript.

I'm not actually sure what this does, so I'm open to suggestions if this isn't a good fix.

@claird claird merged commit a2561ce into claird:master Jun 21, 2020
@douniwan5788
Copy link
Copy Markdown

/JavaScript is automatically executed in /Names under /Catalog, you should only use one of /OpenAction and /Names, not both, this is why the py-pdf#482 bug occurs, /JavaScript is meaningless under /Catalog, so it is completely ignored by pdf. Just removing the line NameObject("/JavaScript"): js_indirect_object, is enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Javascript code added via addJS gets executed twice

3 participants