[scribus] Scribus Python scripting scribus.newDoc syntax

Stefan stmstmstmster at gmail.com
Wed Sep 5 07:55:41 UTC 2012


2012/9/5 Sivahari Nandakumar <sivaharivkm at gmail.com>

> Hai List,
>
> I have to write a python script to create a document with specific
> height,width,bleed,fontsize etc. I think i can use scribus.newDoc function
> for it. But i didnt find any documents about its its syntax in scribus
> documentation. From where i get the manual for python scribus scripting?
>

its inside your scribus copy. Just look in the docs folder -> Files
starting with scripter.

newDoc is obsolete, use newDocument(size, margins, orientation,
firstPageNumber,
                        unit, pagesType, firstPageOrder, numPages) ->
 bool</code <http://december.com/html/4/element/code.html>>
<p <http://december.com/html/4/element/p.html>>Creates a new document and
returns true if successful. The parameters have the
following meaning:
<ul <http://december.com/html/4/element/ul.html>>
<li <http://december.com/html/4/element/li.html>>size = A tuple (width,
height) describing the size of the document. You can
use predefined constants named PAPER_<paper_type> e.g. PAPER_A4 etc.</
li <http://december.com/html/4/element/li.html>>
<li <http://december.com/html/4/element/li.html>>margins = A tuple (left,
right, top, bottom) describing the document
margins</li <http://december.com/html/4/element/li.html>>
<li <http://december.com/html/4/element/li.html>>orientation = the page
orientation - constants PORTRAIT,
LANDSCAPE</li<http://december.com/html/4/element/li.html>
>
<li <http://december.com/html/4/element/li.html>>firstPageNumer = is the
number of the first page in the document used for
pagenumbering. While you'll usually want 1, it's useful to have higher
numbers if you're creating a document in several
parts.</li<http://december.com/html/4/element/li.html>
>
<li <http://december.com/html/4/element/li.html>>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 <http://december.com/html/4/element/li.html>>
<li <http://december.com/html/4/element/li.html>>pagesType = One of the
predefined constants PAGE_n. PAGE_1 is single page,
PAGE_2 is for double sided documents, PAGE_3 is for 3 pages fold and
PAGE_4 is 4-fold.</li <http://december.com/html/4/element/li.html>>
<li <http://december.com/html/4/element/li.html>>firstPageOrder = What is
position of first page in the document.
Indexed from 0 (0 = first).</li <http://december.com/html/4/element/li.html>
>
<li <http://december.com/html/4/element/li.html>>numPage = Number of pages
to be created.</li <http://december.com/html/4/element/li.html>>
</ul <http://december.com/html/4/element/ul.html>>
<p <http://december.com/html/4/element/p.html>>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<http://december.com/html/4/element/p.html>
>
<p <http://december.com/html/4/element/p.html>>example:
newDocument(PAPER_A4, (10, 10, 20, 20), LANDSCAPE, 7, UNIT_POINTS,
PAGE_4, 3, 1)</p <http://december.com/html/4/element/p.html>>
<p <http://december.com/html/4/element/p.html>>May raise ScribusError if is
firstPageOrder bigger than allowed by pagesType.


>
> Thank you
> Sivahari
>
> --
> with warm regards
> Sivahari Nandakumar
> Appropriate Technology Promotion Society
> Eroor, Vyttila 09446582917
> http://sivaharicec.blogspot.com
> --------------------------------------------------------
>       fighting for knowledge freedom
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.scribus.net/pipermail/scribus/attachments/20120905/572e4914/attachment.html
> >
> ___
> Scribus Mailing List: scribus at lists.scribus.net
> Edit your options or unsubscribe:
> http://lists.scribus.net/mailman/listinfo/scribus
> See also:
> http://wiki.scribus.net
> http://forums.scribus.net
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus/attachments/20120905/8e919707/attachment.html>


More information about the scribus mailing list