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

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 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

501

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
Community Expert ,
Mar 14, 2018 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.

Votes

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

Votes

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

Votes

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
Community Expert ,
Mar 14, 2018 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.

Votes

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

Votes

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
Community Beginner ,
Mar 14, 2018 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;

}

}

Votes

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
Enthusiast ,
Mar 15, 2018 Mar 15, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

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