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

Reader and getTemplate

Community Expert ,
Jun 15, 2016 Jun 15, 2016

Hi.

I use this script to unhide a template before printing:

this.getTemplate("LIAISON").hidden = false;

this.print({bUI: false, bShrinkToFit: true, nStart: this.numPages-1});

It Works fine in Acrobat Pro but it fails in Reader.

Error message from the JavaScript Console is:

NotAllowedError: Security settings prevent access to this property or method.

Template.hidden:697:Field Bouton 56:Mouse Up

(tested in Reader DC (Mac & Windows), Reader XI (Windows) and Reader 9 (Mac))

But… the JavaScript API reference shows getTemplate as available for Reader, beginning with version 5, there is not any restrictions in the quickbar.

As shown here : Acrobat DC SDK Documentation

Enable menu items JavaScript execution privileges is ticked in Preferences : JavaScript.

Enable global object security policy is unticked in Preferences : JavaScript.

And the document is trusted in Preferences : Security : Enhanced.

So what can I do to unhide this template in Reader ?

Did I mess something?

Capture 1.pngCapture 4.png


Acrobate du PDF, InDesigner et Photoshopographe
TOPICS
Acrobat SDK and JavaScript , Windows
1.3K
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
Community Expert ,
Jun 15, 2016 Jun 15, 2016

The problem is not with getTemplate, but with the hidden property. It's read-only in Reader.

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
Community Expert ,
Jun 15, 2016 Jun 15, 2016

Thank you.

But I don't understand, the hidden property can be used for layers and fields in Reader…

Where can I get info about this hidden property?


Acrobate du PDF, InDesigner et Photoshopographe
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
Community Expert ,
Jun 15, 2016 Jun 15, 2016

Templates are not the same thing as fields or layers (OCGs)... You can find out more information about it under the hidden property of the Template object. It's clearly stated there.

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
Community Expert ,
Jun 15, 2016 Jun 15, 2016

OK, I found it in the PDF doc. (there are some lacks in the online doc.)

Thank you.


Acrobate du PDF, InDesigner et Photoshopographe
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
Community Expert ,
Jun 15, 2016 Jun 15, 2016

I don't see anything wrong with the online documentation. See here:

Acrobat DC SDK Documentation - Template.hidden

It clearly shows the "X" in the last column of the quick bar.

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
Community Expert ,
Jun 15, 2016 Jun 15, 2016
LATEST

Arrgggllll !

I spent so much time to (not) find it. 

Thank you too.


Acrobate du PDF, InDesigner et Photoshopographe
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