[Scribus] Please help with 'simple' scripting task - print the current document
Gregory Pittman
gpittman
Fri Jun 22 02:37:47 CEST 2007
Bill Hudacek wrote:
> Hi! I need help, and I'm at my wit's end. I'm trying to use scribus to
> print tickets.
>
> I have 4 tickets per page, with 8 named text boxes. I want to stuff a
> ticket number into the two boxes for a ticket (one on ticket, one on
> 'stub'), then do the same for the remaining three tickets. I have this
> working.
>
> Rather than create hundreds of pages in a document, or hundreds of
> documents, I thought I'd simply print the page, then increment my
> counter by 4, repopulate the named text boxes, and print the page
> again...but I cannot figure out how to get the document to print!
>
> I found docs on the "Printer" object on the Scribus web site, but
> there's no info on how you actually use it. None of the examples shows
> how it's used. I even googled for 'allinurl: scribus .py' and spent a
> bit of time reading arbitrary scripts :-)
>
> Does someone have a trivial example of how to print the current document?
>
What you want to do is, first of all, trivialize the problem. You have 2
tasks:
a) printing X number of pages of tickets
b) assigning ticket numbers to each ticket and stub
The first job is "simple" -- make the layout for one ticket, leaving a
blank space for the numbers. Copy this to the page for your four tickets.
Copy your page as many times as you like. Alternatively, make this a
Master Page:
http://wiki.scribus.net/index.php/Working_with_Master_Pages
You don't say how many pages you need. For one or a few dozen, perhaps
making the text boxes for numbering can be done manually: make the
layout of text boxes, group them, copy the group to each page and change
the numbers as needed.
For placing text boxes using a script, check this script:
http://wiki.scribus.net/index.php/Importing_addresses_from_a_text_file
This particular one imports addresses from a text file, then places one
text frame on a page. With modification, you could generate the numbers
with some kind of incrementing loop, and make 8 text boxes per page on
your document. Once you have the script, you can either set it up to
apply the script work to the previous document made with Master Pages,
or make a new document and apply the Master Pages later.
Greg
More information about the scribus
mailing list