English

How To: Use the PageManager Avenue class to set a layout's page size

Summary

The PageManager takes page size input from the user and matches the dimensions to the best available page size in the form of one of the page size enumerators.

Procedure

  1. Open a new script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Paste the following code into the script window:

    Code:
    '-- Assumes that the active doc is a layout with included graphics

    aLayout=av.getactivedoc.getdisplay

    aPoint=Point.Make(7,10) 'the page size is 7 by 10 units
    aSize= aLayout.SetPageSize(aPoint)
    msgbox.info(aPoint.asstring,"The page size is:")

    aPage =aLayout.SetPageSize(aPoint)
    msgbox.info((PageManager.FindSize(aPoint).asstring),"The enumerator used is:")

  3. Select Compile from the Script menu or click the
    [O-Image] Script compile button
    button.
  4. Make the layout active.
  5. Select Run from the Script menu or click the
    [O-Image] Run compiled script button
    button.