Expand my Community achievements bar.

SOLVED

How can I control View Size, and Toolbar Views when a PDF loads?

Avatar

Level 2

at Form:Ready - I need to set the form view ("Fit to Width")and remove the toolbar views (Navigation buttons (hide) and Navigation toolbar - F4, and Top Menu - F8).

How can I code for this?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I woudl put it on the docReady event .....Paul

View solution in original post

6 Replies

Avatar

Former Community Member

The Fit to Width command woudl be:

app.execMenuItem("FitWidth");

Hiding Navigationtoolbar woudl be:

app.execMenuItem("ShowHideToolbarNavigation");

Don't know about the other two ......I will have to look them up when I get a chance.

Paul

Avatar

Level 2

Very cool.

Where are you looking this information up in?

Would love to be in a 'self help' mode more often.

What about if I wanted to 'Fit Actual Size'?

Avatar

Former Community Member

You are controlling Acrobat so you need AcroForms commands for that. I am using the Acrobat Javascritp API reference.

For actual size the command is:

app.execMenuItem("ActualSize");

Paul

Avatar

Level 2

Well, I tried it (thanks for the reference material) - but it is not working.

Is there a particular event I need to set this in?

Currently, I put it in thr form:ready event - with no success.

I'm so close - I can taste it.

Avatar

Correct answer by
Former Community Member

I woudl put it on the docReady event .....Paul

Avatar

Level 2

Everything works - but the result is more of a toggle.

Is there any way to retrieve the state of the toolbar (visible or hidden) and then if the toolbar is visible - then use the JS APIs?

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----