This topic describes advanced APIs for configuring page settings in a presentation file, including the page setup object, page width, page ratio, and page height.
Page setup object
Syntax
Expression.ActivePresentation.PageSetupExpression: A variable that represents the application object for the document type.
Example
async function example() { await instance.ready(); const app = instance.Application; // The presentation object. const presentation = await app.ActivePresentation; // The page setup object. const pageSetup = await presentation.PageSetup; }
Page width
Syntax
Expression.ActivePresentation.PageSetup.SlideWidthExpression: Application object of the document type
Example
async function example() { await instance.ready(); const app = instance.Application; // The presentation object. const presentation = await app.ActivePresentation; // The page setup object. const pageSetup = await presentation.PageSetup; // Get the page width. const slideWidth = await pageSetup.SlideWidth; console.log(slideWidth); }
Page height
Syntax
Expression.ActivePresentation.PageSetup.SlideHeightExpression: document type and application object
Example
async function example() { await instance.ready(); const app = instance.Application; // The presentation object. const presentation = await app.ActivePresentation; // The page setup object. const pageSetup = await presentation.PageSetup; // Get the page height. const slideHeight = await pageSetup.SlideHeight; console.log(slideHeight); }
Page ratio
Syntax
Expression.ActivePresentation.PageSetup.SlideRatioExpression: A variable that represents the application object for the document type.
Return value
Property
Data type
Description
Ratio
number
The page ratio.
Example
async function example() { await instance.ready(); const app = instance.Application; // The presentation object. const presentation = await app.ActivePresentation; // The page setup object. const pageSetup = await presentation.PageSetup; // Get the page ratio. const slideRatio = await pageSetup.SlideRatio; console.log(slideRatio); }
该文章对您有帮助吗?