Skip to main content
Participating Frequently
March 14, 2018
Question

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?

  • March 14, 2018
  • 4 replies
  • 703 views

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?

This topic has been closed for replies.

4 replies

Participating Frequently
March 15, 2018

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;

}

}

Ian Proudfoot
Legend
March 15, 2018

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

Participating Frequently
March 15, 2018

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.

frameexpert
Community Expert
Community Expert
March 14, 2018

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.

www.frameexpert.com
frameexpert
Community Expert
Community Expert
March 14, 2018

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.

www.frameexpert.com
Ian Proudfoot
Legend
March 14, 2018

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.