Pages
currentPage
currentPage() -> integer
Returns the number of the current working page. Page numbers are counted from 1 upwards, no matter what the displayed first page number of your document is.
currentPage
currentPage() -> integer
Returns the number of the current working page. Page numbers are counted from 1 upwards, no matter what the displayed first page number of your document is.
currentPage
currentPage() -> integer Returns the number of the current working page based on the section of the document.
deletePage
deletePage(nr)
Deletes the given page. Does nothing if the document contains only one page. Page numbers are counted from 1 upwards, no matter what the displayed first page number is.
May raise IndexError if the page number is out of range
getAllObjects
getAllObjects([type, page, "layer"]) -> list
Returns a list containing the names of all objects of specified type and located on specified page and/or layer. This function accepts several optional keyword arguments: - type (optional): integer corresponding to item type, by default all items will be returned. - page (optional): index of page on which returned objects are located, by default the current page. The page index starts at 0 and goes to the total number of pages - 1. - layer (optional): name of layer on which returned objects are located, by default the function returns items located on all layers. May throw ValueError if page index or layer name is invalid.
getColumnGuides
getColumnGuides()
Return the column guides for the current page.
The return a dictionary containing: {'number': int, 'gap': int, 'reference': 0|1|2, guides: [real]}
getHGuides
getHGuides() -> list
Returns a list containing positions of the horizontal guides. Values are in the document's current units - see UNIT_
getPageItems
getPageItems() -> list
Returns a list of tuples with items on the current page. The tuple is: (name, objectType, order) E.g. [('Text1', 4, 0), ('Image1', 2, 1)] means that object named 'Text1' is a text frame (type 4) and is the first at the page...
getPageMargins
getPageMargins()
Returns the document page margins as a (top, left, right, bottom) tuple in the document's current units. See UNIT_
getPageNMargins
getPageNMargins(nr) -> tuple
Returns a tuple with a particular page's margins measured in the document's current units. See UNIT_
getPageNSize
getPageNSize(nr) -> tuple
Returns a tuple with a particular page's size measured in the document's current units. See UNIT_
getPageSize
getPageSize() -> tuple
Returns a tuple with document page dimensions measured in the document's current units. See UNIT_
getPageSizeList
getPageSizeList() -> list
Returns a list of untranslated valid page size names and their dimensions in the current unit. See UNIT_
getPageType
getPageType() -> integer
Returns the type of the Page, 0 means left Page, 1 is a middle Page and 2 is a right Page
getRowGuides
getRowGuides()
Return the row guides for the current page.
The return a dictionary containing: {'number': int, 'gap': int, 'reference': 0|1|2, guides: [real]}
getVGuides
getVGuides()
See getHGuides.
gotoPage
gotoPage(nr)
Moves to the page "nr" (that is, makes the current page "nr"). Note that gotoPage doesn't (currently) change the page the user's view is displaying, it just sets the page that script commands will operates on.
May raise IndexError if the page number is out of range.
importPage
importPage("fromDoc", (pageList), [create, imortwhere, importwherePage])
Imports a set of pages (given as a tuple) from an existing document (the file name must be given). This function maps the "Page->Import" dropdown menu function. fromDoc: string; the filename of the document to import pages from pageList: tuple; page numbers of pages to import create: number; 0 to replace existing pages, 1 (default) to insert new pages importWhere: number; used if create==1; 0 to create pages before importWherePage, 1 to create pages after importWherePage, 2 (default) to create pages at the end of the document importWherePage: number; used if create==1 and importWhere==0|1; zero-based page number (of the current document) before or after which to import the pages
newPage
newPage(where [,"masterpage"])
Creates a new page. If "where" is -1 the new Page is appended to the document, otherwise the new page is inserted before "where". Page numbers are counted from 1 upwards, no matter what the displayed first page number of your document is. The optional parameter "masterpage" specifies the name of the master page for the new page.
May raise IndexError if the page number is out of range
pageCount
pageCount() -> integer
Returns the number of pages in the document.
setColumnGuides
setColumnGuides(number, gap=0.0, refer_to=0)
Set the column guides for the current page.
number is the number of guides to be defined (if 0, all values get reset to their default)
refer_to can have the values 0 (page), 1 (margin), 2 (selection)
setHGuides
setHGuides(list)
Sets horizontal guides. Input parameter must be a list of guide positions measured in the current document units - see UNIT_
Example: setHGuides(getHGuides() + [200.0, 210.0] # add new guides without any lost setHGuides([90,250]) # replace current guides entirely
setPageHeight
setPageHeight((height))
Set the document page height in the document's current units. See UNIT_
setPageNHeightg
setPageNHeightg((height))
Set the document page height in the document's current units. See UNIT_
setPagenSize
setPagenSize((width, height))
Set the document page dimensions by the page size name. See UNIT_
setPageNWidth
setPageNWidth((width))
Set the document page width in the document's current units. See UNIT_
setPageSize
setPageSize((width, height))
Set the document page dimensions by the page size name. See UNIT_
setPageWidth
setPageWidth((width))
Set the document page width in the document's current units. See UNIT_
setRowGuides
setRowGuides(number, gap=0.0, refer_to=0)
Set the row guides for the current page.
number is the number of guides to be defined (if 0, all values get reset to their default)
refer_to can have the values 0 (page), 1 (margin), 2 (selection)
setVGuides
setVGuides()
See setHGuides.
Constants
Page sizes
PAPER_A0PAPER_A0_MMPAPER_A1PAPER_A1_MMPAPER_A2PAPER_A2_MMPAPER_A3PAPER_A3_MMPAPER_A4PAPER_A4_MMPAPER_A5PAPER_A5_MMPAPER_A6PAPER_A6_MMPAPER_A7PAPER_A7_MMPAPER_A8PAPER_A8_MMPAPER_A9PAPER_A9_MMPAPER_B0PAPER_B0_MMPAPER_B1PAPER_B10PAPER_B10_MMPAPER_B1_MMPAPER_B2PAPER_B2_MMPAPER_B3PAPER_B3_MMPAPER_B4PAPER_B4_MMPAPER_B5PAPER_B5_MMPAPER_B6PAPER_B6_MMPAPER_B7PAPER_B7_MMPAPER_B8PAPER_B8_MMPAPER_B9PAPER_B9_MMPAPER_C5EPAPER_COMM10EPAPER_DLEPAPER_EXECUTIVEPAPER_FOLIOPAPER_LEDGERPAPER_LEGALPAPER_LETTERPAPER_TABLOID
Page orientation
PORTRAITLANDSCAPE