[scribus] How to print guides, empty image frames and other internal indications ?

a.l.e ale.comp_06 at xox.ch
Thu Sep 1 09:02:23 UTC 2011


salut frédéric


> I am currently designing a page layout with Scribus, having to decide 
> how to arrange my elements, etc.
> 
> I'd like to print the page as I see it within Scribus (so that I can 
> print it in A3, discuss and annotate it), that is, including the
> guides and the frames (even though they may be empty for now).
> 
> I did not find any way of doing this; did I just miss it or is it 
> difficult/impossible ?

... this is a typical task for a script :-)

the script below will add a layer and draw on it a rectangle with
the page margins and vertical / horizontal lines for the guides...


i will add the script to the wiki after having got some feedback...

ciao
a.l.e



--- 8< ---

#!/usr/bin/python

"""
create "printable" guides and page margins for a draft
@author: ale rimoldi
@version: 1.0 / 20110901
@copyright (c) 2011 alessandro rimoldi under the mit license
           http://www.opensource.org/licenses/mit-license.html
"""
import sys
try:
   import scribus
except ImportError:
   print "This script only works from within Scribus"
   sys.exit(1)

page = scribus.getPageSize()
margin = scribus.getPageMargins()

layer = scribus.getActiveLayer()

if ('guides' in scribus.getLayers()) :
    scribus.setActiveLayer('guides')
else:
    scribus.createLayer('guides')


rectangle = scribus.createRect(margin[1], margin[0], (page[0] - \
margin[1] - margin[2]), (page[1] - margin[0] - margin[3]))
scribus.setFillColor('none', rectangle) scribus.setLineColor('Blue', \
rectangle) scribus.setLineWidth(0.4, rectangle)

for item in scribus.getHGuides():
    line = scribus.createLine(0, item , page[0], item)
    scribus.setLineColor('Black', line)
    scribus.setLineWidth(0.6, line)
    scribus.setLineStyle(scribus.LINE_DASHDOT, line)

for item in scribus.getVGuides():
    line = scribus.createLine(item, 0 , item, page[0])
    scribus.setLineColor('Black', line)
    scribus.setLineWidth(0.6, line)
    scribus.setLineStyle(scribus.LINE_DASHDOT, line)

scribus.setActiveLayer(layer)

--- >8 ---



More information about the scribus mailing list