-2

I am writing an Acrobat Javascript script. How can one embed or call some Python code in an Acrobat JavaScript script?

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501
  • Does this help? [Best way to integrate Python and JavaScript?](https://stackoverflow.com/questions/683462/best-way-to-integrate-python-and-javascript) – evolutionxbox Jan 28 '22 at 10:23
  • @evolutionxbox thanks, not entirely as Acrobat Javascript script is only a subset of Javascript from my understanding. Therefore most typical solutions won't apply. – Franck Dernoncourt Jan 28 '22 at 10:25
  • According to https://evermap.com/javascript.asp#What%20is%20Acrobat%20JavaScript? Acrobat JavaScript is a superset of JavaScript, but it has it's own engine. – jabaa Jan 28 '22 at 10:26
  • @FranckDernoncourt then I would think the answer is no. – evolutionxbox Jan 28 '22 at 10:29
  • Depending on what that script is supposed to do, a direct transpilation could work: https://www.infoworld.com/article/3209651/how-to-convert-python-to-javascript-and-back-again.amp.html – CherryDT Jan 28 '22 at 10:37
  • @CherryDT I think the JS in Adobe Acrobat is limited to ES5 syntax/features. – evolutionxbox Jan 28 '22 at 10:38
  • @evolution That article features several different options. Jiphy for instance produces ES5 code (or at least did so, and nobody would stop you from using an earlier version in case newer versions don't). – CherryDT Jan 28 '22 at 10:40

1 Answers1

0

According to an experienced Acrobat user on https://community.adobe.com/t5/acrobat-sdk-discussions/how-can-one-embed-or-call-some-python-code-in-a-acrobat-javascript-script/m-p/12712912#M88574, it's not possible to embed or call some Python code in an Acrobat JavaScript script. I'm guessing the only solution is attempting to convert the python code into some JavaScript that Acrobat understands.

Franck Dernoncourt
  • 77,520
  • 72
  • 342
  • 501