Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Huge problem: Javascript editors won't display all content

Participant ,
Oct 25, 2022 Oct 25, 2022

Hey, this just happened to a completed form, and is now happening in several forms. 

If I open a javascript editor with more than 15 lines or so, only that first 15 lines shows up. The code is clearly longer: I can select lower lines, scroll to the end, etc. But the lines appear blank. I can copy/paste the field into a third party editor, which reveals the entire code. But I cannot see it in Acrobat. 

Additionally, I am on a Mac. I cannot switch acrobat's editor to my own editor (VS Code) without acrobat crashing. This is a known issue for macs. 

One such file has about 12000 lines of code (including acrobat's XML). I was actually in the process of optimizing this code to make it shorter when this wierd phenomenon started happening.

 

Any ideas?

TOPICS
JavaScript , PDF forms
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2022 Oct 25, 2022

" I am on a Mac. I cannot switch acrobat's editor to my own editor (VS Code) without acrobat crashing. "

 

Are you copying and pasting directly from VS Code editor to the Acrobat JavaScript editor?

 

If you are, I am confused.

 

Visual Studio code is not the same syntax to chieve a desired result with the  Acrobat JavaScript.

 

Can you clarify what exactly are you trying to do between two different programming languages.

 

In addition, please share :

 

  • what macOS version are you on?

 

  • is the Apple hardware that your macOS is on using  an M1 chip that requires Rosetta?

 

  • What Adobe Acrobat Pro version is on that macOS

 

  • what is the third-party editor?

 

Until you respond back with more details, I will assume that the issue could be related somewhere in-between the unicode type employed by both your VS Code editor and the macOS and the third-party editor.

 

But going back to the action of copying and pasting from one editor to another and then to the Acrobat JavaScript editor, see if you are able to save the code in plain text first in the third-party editor.

 

Only then, try copying that plain text content from that third-party editor and paste it in the Acrobat JavaScript.

 

The third-party editor should have a feature to switch to an UTF type that matches the UTF type used by your macOS, so that the content that is saved temporarily in the clipboard ( before it is executed via the paste action) is properly mapped (or retained).

 

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 25, 2022 Oct 25, 2022

Hi there, sorry for the confusion. 

1. I am only writing in JavaScript, copied from VS Code into functions in document-level editor in Acrobat, as well as in various Field Properties editor in Acrobat (i.e. OnBlur, OnFocus, Custom Formatting). 

2. I do not write XML code. In case my issue relates to my codes being too long, I report that one pdf includes 12000 lines of code in the All JavaScripts editor, including the lines of XML which acrobat adds itself. I am not an expert in this.
I hope this is clear. 

 

Mac OS: 13.0 (22A380)

Not M1 Mac; 2019 Macbook Pro. Previously, some work was done on an M1 iMac. I am not sure if the same issue appears there. The issue is currently on the 2019 MBP.

Adobe Acrobat Pro 2020, 2020 Release (Classic), Version 2020.005.30407

3rd Party Editor: As mentioned, I do not use a third party editor. I write javascript in vscode, copy paste to acrobat's various editor windows. I have tried to connect even a basic third party editor, TextEdit. All JavaScripts opens in TextEdit, I save, close the app, but Acrobat remains frozen. I never tried a different text editor because I read, on this forum, that external editors do not work reliably with acrobat on a mac: https://community.adobe.com/t5/acrobat-sdk-discussions/javascript-editor-for-mac-using-parallels/m-p....

Another clarifying point: starting today, the javascript I copy/paste from VS Code to Acrobat only partially appears, as I describe above. Any scrolling reduces the visibility of the remaining text even further, suggesting a glitch. This happens in any editor window within acrobat now.

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2022 Oct 25, 2022

Very interesting.

 

I am still curious to see what the behavior would be if you copy all the code eith the macOS native editor: TextEdit

 

Then change the encoding to Plain text using this tip:

 

 

And also change the font type in both editors (Acrobat and TextEdit to something like Arial, Helvetica, Courier or Times New Roman).

 

Another possible way to work around this noted bug could beto save those long scripts as document-level functions  with global variables, and invoke such functions from the desired field objects.

 

I am starting to think that, as you continue work around with that PDF document, you may want to also disable JavaScript of performing calculations automatically (Edit-->> Preferences) until you're done with all the  scripts (specially if most scripts are validating or  custom calculating scripts).

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 25, 2022 Oct 25, 2022

I will be working your suggestions, many thanks for this. 

My home M1 iMac, operating acrobat pro dc instead of 2020, has no problem reading the pdfs. The plot thickens.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2022 Oct 25, 2022
LATEST

You're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines