Highlighted

fit page in window in framemaker.i have used var zoom= oDoc.Constants.FV_FIT_WINDOW_TO_PAGE; in javascript code.The result is -3.but nothing change in framemaker document.how to i change the zoom level in framemaker using extendscript?

Community Beginner ,
Mar 14, 2018

Copy link to clipboard

Copied

fit page in window in framemaker.i have used var zoom= oDoc.Constants.FV_FIT_WINDOW_TO_PAGE; in javascript code.The result is -3.but nothing change in framemaker document.how to i change the zoom level in framemaker using extendscript?

TOPICS
Scripting

Views

330

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

fit page in window in framemaker.i have used var zoom= oDoc.Constants.FV_FIT_WINDOW_TO_PAGE; in javascript code.The result is -3.but nothing change in framemaker document.how to i change the zoom level in framemaker using extendscript?

Community Beginner ,
Mar 14, 2018

Copy link to clipboard

Copied

fit page in window in framemaker.i have used var zoom= oDoc.Constants.FV_FIT_WINDOW_TO_PAGE; in javascript code.The result is -3.but nothing change in framemaker document.how to i change the zoom level in framemaker using extendscript?

TOPICS
Scripting

Views

331

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

Copy link to clipboard

Copied

This is the correct syntax:

var doc = app.ActiveDoc;

doc.Zoom = Constants.FV_FIT_WINDOW_TO_PAGE;

However, this constant doesn't work as expected. Let me see if I can figure out the right one.

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
Reply
Loading...
Mar 14, 2018 1
Enthusiast ,
Mar 14, 2018

Copy link to clipboard

Copied

This works exactly as expected for me. It matches the command in the zoom dropdown where the document window is un-docked and the window matches the size of the document. However we do see strange results when more than one document has its window fit to the page, but that's not a scripting problem.

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
Reply
Loading...
Mar 14, 2018 0
Community Beginner ,
Mar 14, 2018

Copy link to clipboard

Copied

Thank u.It's working..but i need Increase and decrease the zoomlevel in framemaker document using percentage when i click the checkbox.. Is it possible or not ? i have used in this code

var doc = app.ActiveDoc;

doc.Zoom=1.4; The result is 1.4.But no movement in the framemaker document.

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
Reply
Loading...
Mar 14, 2018 0
Adobe Community Professional ,
Mar 14, 2018

Copy link to clipboard

Copied

This fits the page of a docked document to the document window. I am not sure if this is what you want.

Fcodes ([FCodes.KBD_ZOOM_FIT_PAGE]);

Fcodes require an active document.

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
Reply
Loading...
Mar 14, 2018 0
Community Beginner ,
Mar 14, 2018

Copy link to clipboard

Copied

Thank u.It's working..but i need Increase and decrease the zoomlevel in framemaker document using percentage when i click the checkbox.. Is it possible or not ? i have used in this code

var doc = app.ActiveDoc;

doc.Zoom=1.4; The result is 1.4.But no movement in the framemaker document.

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
Reply
Loading...
Mar 14, 2018 0
Community Beginner ,
Mar 14, 2018

Copy link to clipboard

Copied

Thank u.It's working..but i need Increase and decrease the zoomlevel in framemaker document using percentage when i click the checkbox.. Is it possible or not ? i have used in this code

var doc = app.ActiveDoc;

Checkbox.onClick = function () {

if (CheckBox.cheked ==true){

  doc.Zoom = 80;

}

}

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
Reply
Loading...
Mar 14, 2018 0
Enthusiast ,
Mar 15, 2018

Copy link to clipboard

Copied

In FrameMaker many numeric values are handled as FrameMaker's Metric values. This allows the values to always be handled as integers. In this system for a zoom level of 100%, FrameMaker expects an FM Metric value of 65536.

So to get a zoom of 80% simply multiply 65536 by 0.8. In your code this would be:

  doc.Zoom = 0.8*65536;

Ian

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
Reply
Loading...
Mar 15, 2018 1