File: scripterapi-doc.html

package info (click to toggle)
scribus-doc 1.2.1-2
  • links: PTS
  • area: non-free
  • in suites: sarge
  • size: 2,920 kB
  • ctags: 374
  • sloc: makefile: 387; xml: 110
file content (79 lines) | stat: -rw-r--r-- 5,176 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<qt>
<title>Document related Commands</title>
<h2>Document related Commands</h2>

<dl>

<dt><a name="-closeDoc"><strong>closeDoc</strong></a>(...)</dt>
<dd><code><a href="#-closeDoc">closeDoc</a>()</code>
<p>Closes the current document without prompting to save.</p>
<p>May throw <a href="#NoDocOpenError">NoDocOpenError</a> if there is no document to close</p></dd>

<dt><a name="-docChanged"><strong>docChanged</strong></a>(...)</dt>
<dd><code><a href="#-docChanged">docChanged</a>(bool)</code>
<p>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.</p></dd>

<dt><a name="-getUnit"><strong>getUnit</strong></a>(...)</dt>
<dd><code><a href="#-getUnit">getUnit</a>() -&gt; integer (Scribus unit constant)</code>
<p>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.</p></dd>
	
<dt><a name="-haveDoc"><strong>haveDoc</strong></a>(...)</dt>
<dd><code><a href="#-haveDoc">haveDoc</a>() -&gt; bool</code>
<p>Returns true if there is a document open.</p></dd>

<dt><a name="-loadStylesFromFile"><strong>loadStylesFromFile</strong></a>(...)</dt>
<dd><code><a href="#-loadStylesFromFile">loadStylesFromFile</a>("filename")</code>
<p>Loads paragraph styles from the Scribus document at "filename" into the current document.</p></dd>
	
<dt><a name="-newDoc"><strong>newDoc</strong></a>(...)</dt>
<dd><code><a href="#-newDoc">newDoc</a>(size, margins, orientation, firstPageNumber, unit, facingPages, firstSideLeft) -&gt; bool</code>
<p>Creates a new document and returns true if successful. The parameters have the
following meaning:</p>
<ul>
	<li>size = A tuple (width, height) describing the size of the document. You can use predefined constants named PAPER_&lt;paper_type&gt; e.g. PAPER_A4 etc.</li>
	<li>margins = A tuple (left, right, top, bottom) describing the document margins</li>
	<li>orientation = the page orientation - constants PORTRAIT, LANDSCAPE</li>
	<li>firstPageNumber = is the number of the first page in the document used for page numbering. While you'll usually want 1, it's useful to have higher numbers if you're creating a document in several parts.</li>
	<li>unit: this value sets the measurement units used by the document. Use a predefined constant for this, one of: UNIT_INCHES, UNIT_MILLIMETERS, UNIT_PICAS, UNIT_POINTS.</li>
	<li>facingPages = FACINGPAGES, NOFACINGPAGES</li>
	<li>firstSideLeft = FIRSTPAGELEFT, FIRSTPAGERIGHT</li>
	</ul>
<p>The values for width, height and the margins are expressed in the given unit for the document. PAPER_* constants are expressed in points. If your document is not in points, make sure to account for this.</p>
<p>example: <a href="#-newDoc">newDoc</a>(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 1, UNIT_POINTS, FACINGPAGES, FIRSTPAGERIGHT)</p></dd>

<dt><a name="-openDoc"><strong>openDoc</strong></a>(...)</dt>
<dd><code><a href="#-openDoc">openDoc</a>("name")</code>
<p>Opens the document "name".</p>
<p>May raise ScribusError if the document could not be opened.</p></dd>
	
<dt><a name="-saveDoc"><strong>saveDoc</strong></a>(...)</dt>
<dd><code><a href="#-saveDoc">saveDoc</a>()</code>
<p>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.</p></dd>

<dt><a name="-saveDocAs"><strong>saveDocAs</strong></a>(...)</dt>
<dd><code><a href="#-saveDocAs">saveDocAs</a>("name")</code>
<p>Saves the current document under the new name "name" (which may be a full or
relative path).</p>
<p>May raise ScribusError if the save fails.</p></dd>

<dt><a name="-setInfo"><strong>setInfo</strong></a>(...)</dt>
<dd><code><a href="#-saveDocAs">saveDocAs</a>("author", "info", "description") -&gt; bool</code>
<p>Sets the document information. "Author", "Info", "Description" are strings.</p></dd>
	
<dt><a name="-setMargins"><strong>setMargins</strong></a>(...)</dt>
<dd><code><a href="#-setMargins">setMargins</a>(lr, rr, tr, br)</code>
<p>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_&lt;type&gt; constants.</p></dd>

<dt><a name="-setDocType"><strong>setDocType</strong></a>(...)</dt>
<dd><code><a href="#-setDocType">setDocType</a>(facingPages, firstPageLeft)</code>
<p>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.</p></dd>
	
<dt><a name="-setUnit"><strong>setUnit</strong></a>(...)</dt>
<dd><code><a href="#-setUnit">setUnit</a>(type)</code>
<p>Changes the measurement unit of the document. Possible values for "unit" are defined as constants UNIT_&lt;type&gt;.</p>
<p>May raise ValueError if an invalid unit is passed.</p></dd>

</dl>
</qt>