This topic describes how to obtain or set the scale of a document window and whether to scale the view to fit the document window after it is resized when you use a text document.
Obtain or set the window scale
Obtain or set the window scale.
Syntax
Expression.ActiveDocument.ActiveWindow.View.Zoom.PercentageExpression: the document type application object.
Example
async function example() { await instance.ready(); const app = instance.Application; // Obtain the window scale. const result = await app.ActiveDocument.ActiveWindow.View.Zoom.Percentage; console.log(result); // The default window scale is 100%. // Set the window scale. setTimeout(() => { app.ActiveDocument.ActiveWindow.View.Zoom.Percentage = 40; }, 3000); }
Set autofit for the view
Specify whether to enable autofit for the view to fit the document window after the window is resized.
Syntax
Expression.ActiveDocument.ActiveWindow.View.Zoom.PageFit = NumberExpression: the document type application object.
Valid values of
Number:0: Does not scale the view to fit the document window after it is resized.
2: Scales the view to fit the document window after it is resized.
Example
async function example() { await instance.ready(); const app = instance.Application; // Do not scale the view to fit the document window after it is resized. app.ActiveDocument.ActiveWindow.View.Zoom.PageFit = 0; }
该文章对您有帮助吗?