closeDoc()
Closes the current document without prompting to save.
May throw NoDocOpenError if there is no document to close
docChanged(bool)
Enable/disable save icon in the Scribus icon bar and the Save menu item. It's useful to call this procedure when you're changing the document, because Scribus won't automatically notice when you change the document using a script.
getDocName() -> string
Returns the name of current file
getUnit() -> integer (Scribus unit constant)
Returns the measurement units of the document. The returned value will be one of the UNIT_* constants: UNIT_INCHES, UNIT_MILLIMETERS, UNIT_PICAS, UNIT_POINTS.
Typically you may use this command so that you can change the measurement units to something else, for which you are creating or modifying objects based some particular units, like points, after which you want to return to whatever the original units were.
original = getUnit()
do some operations...then later
setUnit(original)
haveDoc() -> bool
Returns true if there is a document open. Since this returns a boolean, typically this will be used in a conditional clause:
if haveDoc():
so that you can deal with the situation where no document exists with an else: clause.
loadStylesFromFile("filename")
Loads paragraph styles from the Scribus document at "filename" into the current document.
masterPageNames()
Returns a list of the names of all master pages in the document.
newDoc(size, margins, orientation, firstPageNumber, unit, facingPages, firstSideLeft) -> bool
WARNING: Obsolete procedure! Use newDocument instead. Also note that this commands requires 7 parameters, whereas the preferred newDocument() command requires 8.
Creates a new document and returns true if successful. The parameters have the following meaning:
The values for width, height and the margins are expressed in the given unit for the document. PAPER_* constants are a series of tuples specific to the document size, with the values corresponding to points. Therefore, if you are creating a document and using UNIT_MILLIMETERS for example, DO NOT USE the PAPER_* constants. A workaround can be to use the PAPER_* constant along with UNIT_POINTS, then follow the command with another command, setUnit(UNIT_MILLIMETERS).
example: newDoc(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 1, UNIT_POINTS, FACINGPAGES, FIRSTPAGERIGHT)
newDocument(size, margins, orientation, firstPageNumber,
unit, pagesType, firstPageOrder, numPages) -> bool
Note that this commands requires 8 parameters, whereas the obsolete newDoc() command required 7. The additional parameter indicates how many pages to create.
Creates a new document and returns true if successful. The parameters have the following meaning:
The values for width, height and the margins are expressed in the given unit for the document. PAPER_* constants are a series of tuples specific to the document size, with the values corresponding to points. Therefore, if you are creating a document and using UNIT_MILLIMETERS for example, DO NOT USE the PAPER_* constants.
For A and B paper formats there are now new constants to use with UNIT_MILLIMETERS, named for example, PAPER_A4_MM, or PAPER_B6_MM.
Examples:
newDocument(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 7, UNIT_POINTS, PAGE_4, 3, 1)
newDocument(PAPER_A4_MM, (10, 10, 20, 20), LANDSCAPE, 7, UNIT_MILLIMETERS, PAGE_4, 3, 1)
May raise ScribusError if is firstPageOrder bigger than allowed by pagesType.
openDoc("name")
Opens the document "name".
May raise ScribusError if the document could not be opened.
placeEPS("filename", x, y)
Places the EPS "filename" onto the current page, x and y specify the coordinate of the topleft corner of the EPS placed on the page.
If loading was successful, the selection contains the imported EPS.
placeODG("filename", x, y)
Places the ODG "filename" onto the current page, x and y specify the coordinate of the topleft corner of the ODG placed on the page.
If loading was successful, the selection contains the imported ODG.
placeSVG("filename", x, y)
Places the SVG "filename" onto the current page, x and y specify the coordinate of the topleft corner of the SVG placed on the page.
If loading was successful, the selection contains the imported SVG.
placeSXD("filename", x, y)
Places the SXD "filename" onto the current page, x and y specify the coordinate of the topleft corner of the SXD placed on the page.
If loading was successful, the selection contains the imported SXD.
placeVectorFile("filename", x, y)
Places the vector graphics "filename" onto the current page, x and y specify the coordinate of the topleft corner of the graphic placed on the page.
If loading was successful, the selection contains the imported graphic.
revertDoc()
Revert the current document to its last saved state.
saveDoc()
Saves the current document with its current name, returns true if successful. If the document has not already been saved, this may bring up an interactive save file dialog. If the save fails, there is currently no way to tell.
saveDocAs("name")
Saves the current document under the new name "name" (which may be a full or relative path).
May raise ScribusError if the save fails.
setBaseLine(grid, offset)
Sets the base line settings of the document, grid spacing(grid), grid offset(offset). Values are given in the measurement units of the document - see UNIT_<type> constants.
setBleeds(lr, rr, tr, br)
Sets the bleeds of the document. Left(lr), Right(rr), Top(tr) and Bottom(br) bleeds are given in the measurement units of the document - see UNIT_<type> constants.
setDocType(facingPages, firstPageLeft)
Sets the document type. To get facing pages set the first parameter to FACINGPAGES, to switch facingPages off use NOFACINGPAGES instead. If you want to be the first page a left side set the second parameter to FIRSTPAGELEFT, for a right page use FIRSTPAGERIGHT.
setInfo("author", "info", "description") -> bool
Sets the document information. "Author", "Info", "Description" are strings.
setMargins(lr, rr, tr, br)
Sets the margins of the document, Left(lr), Right(rr), Top(tr) and Bottom(br) margins are given in the measurement units of the document - see UNIT_<type> constants.
setUnit(type)
Changes the measurement unit of the document. Possible values for "unit" are defined as constants UNIT_<type>.
May raise ValueError if an invalid unit is passed.
As noted above, typically you may use this command so that you can change the measurement units to something else, for which you are creating or modifying objects based some particular units, like points, after which you want to return to whatever the original units were.
original = getUnit()
do some operations...then later
setUnit(original)
scrollDocument(x,y)
Scroll the document in main GUI window by x and y.
zoomDocument(double)
Zoom the document in main GUI window. Actions have whole number values like 20.0, 100.0, etc. Zoom to Fit uses -100 as a marker.