[Scribus] Re: Automatic Page numbering

Randolph Bentson bentson
Tue Mar 25 15:24:08 CET 2003


On Tue, Mar 25, 2003 at 06:11:59PM +0530, Manoj Nair wrote:
> How to do automatic pagenumbering in scribus?

I wrote this simple program.  It is far from general purpose...a
few minutes thinking would have me adding many more capabilities.
For instance, I should have determined the page size dynamically
and it should be idempotent, i.e., it should remove existing page
numbering before inserting new page numbering.

> And how to define headers and footers?

Don't know.

-- 
Randolph Bentson
bentson at holmsjoen.com
-------------- next part --------------
# This Script puts page numbers on all but first and last pages.

from scribus import *

pagewidth = 396
pageheight = 612
lr_margin = 18
tb_margin = 9

fontsize = 9
fontname = "Nimbus Sans Bold"
width = 50
height = fontsize + 6
y = pageheight - 2*tb_margin - height

if HaveDoc():

    for page in range(2,PageCount()):
        GotoPage(page)
        str = "Page %d" % page
        if page % 2:
            x = pagewidth - lr_margin - width
            a = 2
        else:
            x = lr_margin
            a = 0
        ob = CreateText(x,y,width,height,str)
        SelectObject(str)
        SetTextAlignment(a)
        SetFont(fontname)
        SetFontSize(fontsize)
        SetText(str, ob)




More information about the scribus mailing list