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

Save initial view navigation tab setting

Guru ,
Nov 08, 2016 Nov 08, 2016

Hi

this.pane = 'Bookmark'; will open the bookmark panel on the open document, however it does not set the initial view navigation tab setting.

So when the document is closed (after saving) it still won't set the document to open with the bookmark tab open.

Is there a way (execMenuItem and messing with the registry?) to do this.

Thanks

Trevor

Would be good to know for both Windows and Mac

TOPICS
Acrobat SDK and JavaScript , Windows
1.4K
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 ,
Nov 08, 2016 Nov 08, 2016

Just embed the code at the document-level. Or better yet, simply set the Initial View setting (under File - Properties) to show the Bookmarks panel.

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
Guru ,
Nov 08, 2016 Nov 08, 2016

Hi Try

Thanks for your answer.

Can you give a little snippet for what you mean of embedding the code in the document level?

Do you mean including the script in the document so it will run when the document is opened?

If that's the case then the 'opener' will need to have his js set to run which is not necessarily so.

Need to do this with JS and not the UI so unless I misunderstood your second options not god for me.

Regards

Trevor

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 ,
Nov 08, 2016 Nov 08, 2016

I can explain, but why do you want to do it using JS instead of the built-in option?

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
Guru ,
Nov 08, 2016 Nov 08, 2016

Because I want to automate it.

The basic Idea is to automate exporting a document from InDesign into a PDF and sending it as an email.

This can be achieved by running the jsx script from InDesign and have the jsx script use vsb or applescript to communicate with the other applications, like outlook and acrobat. Acrobat and outlook (not really needed as one can send strait from acrobat) would ideally do their stuff with hidden windows and no user interaction. The requirement is that the bookmarks panel should be defaulted to open.

In summary press some script shortcut key from InDesign and the boss / client has the PDF document in the way he wants it.

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 ,
Nov 08, 2016 Nov 08, 2016

You should check the settings of ID if it's not possible to set the Initial View there... If not, you can execute this code:

this.addScript("load", "this.pane = 'Bookmark';");

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
Guru ,
Nov 08, 2016 Nov 08, 2016

This is a good start but it is a problem that the js has be set to enabled on the openers end.

Because I am trying to save it from outside of Acrobat using AForm.Fields.ExecuteThisJavaScript I get the following bug when trying to save

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

  Doc.saveAs:1:External undefined:Exec'

I can probably get around that by saving the doc with 'pure vbs'

I would be happy to hear if there's any more solid way avoiding the script embedding and the changing the security settings.

Can one change the security settings to avoid the saveAs problem?

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
Guru ,
Nov 08, 2016 Nov 08, 2016
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 ,
Nov 08, 2016 Nov 08, 2016

I'm not sure what I'm supposed to see there... I gave you the code to use to achieve what you wanted.

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
New Here ,
Nov 08, 2016 Nov 08, 2016

I tried this code (saved it to the pdf document javascripts) but it doesn't open the bookmarks panel when you close the doc then reopen it.

Is there a way of saving this setting without physically doing it the "built-in way"?

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
Guru ,
Nov 08, 2016 Nov 08, 2016
LATEST

To see it work you have to close Acrobat and reopen it (I think) the debugger should be closed

My not fully working vbs is

Set App = CreateObject("Acroexch.app")

app.show

Set AForm = CreateObject("AFormAut.App")

acrobatJsScript = "var doc = app.openDoc({cPath: 'C:\\Users\\Trevor\\Desktop\\Test\\test2.pdf'});this.addScript('load', 'this.pane = \'Bookmark\'');this.saveAs({cPath: 'C:\\Users\\Trevor\\Desktop\\Test\\test2.pdf'});"

AForm.Fields.ExecuteThisJavaScript acrobatJsScript

I'm going out now so I won't give any quick response.

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