Problem with earlier Reader versions

Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

I made a PDF form with Acrobat XI that should show/hide layers using JS depending on if the user checks or unchecks a checkbox.

At first sight it worked fine either on Acrobat Pro as well Reader DC.

I tested it with Reader X (2010) and it worked but didn't allow me to save the changes -- that make it totally pointless to me

My boss tested it on a different early Reader (don't know the version) and it didn't work at all. In his case the worse part is that it didn't tell that there was something wrong neither ask for an upgrade. It just didn't work.

There is a way to control this?

TOPICS
Acrobat SDK and JavaScript, Windows

Views

117

Likes

Translate

Translate

Report

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

correct answers 1 Correct Answer

Most Valuable Participant , Mar 19, 2018 Mar 19, 2018
You can try Reader-enabling the files, but that's about it. The simple solution is to upgrade to a newer version of Reader...

Likes

Translate

Translate
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

You can try Reader-enabling the files, but that's about it. The simple solution is to upgrade to a newer version of Reader...

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Thanks for the heads up, try67!

I tried the Reader enabled option and now it allowed me to save the changes in the form. As mentioned I tried it in Reader X and everything worked perfectly to me. IMO it's more than I would expect using an 8-years old version.

I still don't know what version my boss used and that didn't work. I am really curious about this but probably is something still older.

I fully agree with you that an upgrade is mandatory, however I still think that Reader should pop up an alert when the opened PDF brings a non-supported feature rather than just ignore it as everything was fine. It causes me a certain level of "insecurity".

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

You can have your script look at the app.viewerVersion property and branch your code accordingly. You can even pop up an alert if the version is too low.

J-

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

As far as I know I would have to embed the script to do that at document-level, that's right? I stayed looking for how to do in Acrobat XI that but couldn't find. Any clue?

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

It's in the JavaScripts tool set.

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Do you have Acrobat XI Standard or Pro? Only the latter gives you direct access to the doc-level scripts UI, but you can still do it using a script if you have the Standard version.

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Mine is Acrobat XI Pro but I have no idea where to put it. There is an 'Action Wizard' under tools but the only thing it allows me is to create actions (that includes JS) to be added as 'tools' in the toolbar. I think I need something that I could force to be executed as soon the PDF be opened and I have no idea where it should be put...

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

It's under Tools - JavaScript - Document JavaScripts...

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Ah! I finally found it (it was hidden). Thank you!

However now the 'Document Javascript' option is there but greyed out... any idea?

frust.jpg

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

You have to do it before you Reader-enable the file...

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Thank you very much for your HUGE patience! I am almost there. I already was able to write an action (actually a function) and make it run when a document 'event' happens. However, I have available only the following 'events':

frust2.jpg

I need something like 'Document Did Open'. There is a way of add it or I have to be happy only with the options above?

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Use the Document JavaScripts window to add code that is executed when the file is opened.

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

I did that indeed! Let me show you step by step...

First I opened "Document Javascript" and set my custom function there. I made a simple one with an alert popup and called it "InitialCheck":

screen1.jpg

Then I opened "Set Document Actions" and attached my action to one of the available document events for testing. This way:

screen2.jpg

Then I saved the document and opened it with my old Reader X and when I tried to close it I got the popup meaning that it is working:

screen3.jpg

The problem is that in the "Document Actions" list I only have these options:

Document Will Close

Document Will Save

Document Did Save

Document Will Print

Document Did Print

But I don't have any "Document Did Open" that's what I really need... What am I missing here?

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

If you want the code in the function to be executed when the file is opened then add a call to it after the function definition.

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

Cool, thank you very much one more time! It worked exactly as I need!

A final couple of questions:

1) There is a way to force application close if the requisite doesn't match?

2) Would you point me the documentation where I can find the JS app methods I can use, etc?

Thank you very much again for your time and knowledge!

Likes

Translate

Translate

Report

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
Most Valuable Participant ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

1) No. You can close the file, though.

2) Adobe - Acrobat Developer Center | Adobe Developer Connection

Likes

Translate

Translate

Report

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 ,
Mar 19, 2018 Mar 19, 2018

Copy link to clipboard

Copied

LATEST

Thank you for everything! I am on my way now! Cheers!

Likes

Translate

Translate

Report

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