Creating Markers for positioning and cutting

from scribus import * defineColor("transparent", 0, 0, 0, 0 ) defineColor("cyan", 255, 0, 0, 0 ) defineColor("magenta", 0, 255, 0, 0 ) defineColor("gelb", 0, 0, 255, 0 ) defineColor("cyan50", 128, 0, 0, 0 ) defineColor("magenta50", 0, 128, 0, 0 ) defineColor("gelb50", 0, 0, 128, 0 ) defineColor("rot", 0, 255, 255, 0 ) defineColor("gruen", 255, 0, 255, 0 ) defineColor("blau", 255, 255, 0, 0 ) defineColor("schwarz", 0, 0, 0, 255 ) defineColor("schwarz90", 0, 0, 0, 230 ) defineColor("schwarz80", 0, 0, 0, 205 ) defineColor("schwarz70", 0, 0, 0, 179 ) defineColor("schwarz60", 0, 0, 0, 154 ) defineColor("schwarz50", 0, 0, 0, 128 ) defineColor("schwarz40", 0, 0, 0, 102 ) defineColor("schwarz30", 0, 0, 0, 77 ) defineColor("schwarz20", 0, 0, 0, 51 ) defineColor("schwarz10", 0, 0, 0, 26 ) defineColor("alle", 255, 255, 255, 255 )
 * 1) !/usr/bin/env python2.3
 * 2) -*- coding: utf-8 -*-
 * 3) Schneid-Passer-Marken.py von Albert Dietz, 27.05.05
 * 4) this script (my first Pyhton and Scribus-Script) generates markers for
 * 5) positioning cmyk masks and cutting
 * 6) the markers will be set onto the existing document at 1cm spacing to the papersize
 * 7) that means that your A4-Layout should be 230x317mm
 * 8) Attention: disable "under color reduction"! otherwise you will not see the
 * 9) cyan, magenta and yellow markers
 * 10) feel free to modify this script and please send comments to albert@jadietz.de
 * 11) thank you for reading this.

def einPasser( x, y, Breite, Farbe ): Kreisradius = 0.5*Breite*0.8 k13 = createEllipse( x-Kreisradius, y-Kreisradius, 2*Kreisradius, 2*Kreisradius) setLineWidth(0.5, k13) setFillColor("transparent", k13) setLineColor(Farbe, k13) k11 = CreateLine( x-Breite/2, y, x+Breite/2, y)          	setLineWidth(0.5, k11) setLineColor(Farbe, k11) k12 = CreateLine( x, y-Breite/2, x, y+Breite/2 ) setLineWidth(0.5, k12) setLineColor(Farbe, k12)

def allePasser( Breite, Farbe): einPasser( 0.5*Breite, pageHeight/2, 0.8*Breite, Farbe ) einPasser( pageWidth/2, 0.5*Breite, 0.8*Breite, Farbe ) einPasser( pageWidth-0.5*Breite, pageHeight/2, 0.8*Breite, Farbe ) einPasser( pageWidth/2, pageHeight-0.5*Breite, 0.8*Breite, Farbe )

def Schnitte( Abstand, Farbe ): Laenge = 0.8*Abstand l1 = CreateLine( 0, Abstand, Laenge, Abstand) setLineWidth(0.5, l1) setLineColor(Farbe, l1) l2 = CreateLine( Abstand, 0, Abstand, Laenge) setLineWidth(0.5, l2) setLineColor(Farbe, l2) l3 = CreateLine( pageWidth-Abstand, 0, pageWidth-Abstand, Laenge) setLineWidth(0.5, l3) setLineColor(Farbe, l3) l4 = CreateLine( pageWidth-Laenge, Abstand, pageWidth, Abstand) setLineWidth(0.5, l4) setLineColor(Farbe, l4) l5 = CreateLine( 0, pageHeight-Abstand, Laenge, pageHeight-Abstand) setLineWidth(0.5, l5) setLineColor(Farbe, l5) l6 = CreateLine( Abstand, pageHeight, Abstand, pageHeight-Laenge) setLineWidth(0.5, l6) setLineColor(Farbe, l6)

l7 = CreateLine( pageWidth-0, pageHeight-Abstand, pageWidth-Laenge, pageHeight-Abstand) setLineWidth(0.5, l7) setLineColor(Farbe, l7) l8 = CreateLine( pageWidth-Abstand, pageHeight, pageWidth-Abstand, pageHeight-Laenge) setLineWidth(0.5, l8) setLineColor(Farbe, l8)

if haveDoc: setUnit(UNIT_MILLIMETERS) pageWidth, pageHeight = getPageSize Schnitte( 10, "alle" ) allePasser( 10, "alle" ) # Graukeil x = pageWidth/2 - 12*4 r01 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz90", r01 ) x = x+4 r02 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz80", r02 ) x = x+4 r03 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz70", r03 ) x = x+4 r04 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz60", r04 ) x = x+4 r05 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz50", r05 ) x = x+4 r06 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz40", r06 ) x = x+4 r07 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz30", r07 ) x = x+4 r08 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz20", r08 ) x = x+4 r09 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz10", r09 ) x = x+4 r10 = CreateRect( x, 2, 4, 4 ) setFillColor ("transparent", r10 ) # Farben x = pageWidth/2 + 2*4 r11 = CreateRect( x, 2, 4, 4 ) setFillColor ("gelb", r11 ) x = x+4 r12 = CreateRect( x, 2, 4, 4 ) setFillColor ("magenta", r12 ) x = x+4 r13 = CreateRect( x, 2, 4, 4 ) setFillColor ("cyan", r13 ) x = x+4 r14 = CreateRect( x, 2, 4, 4 ) setFillColor ("blau", r14 ) x = x+4 r15 = CreateRect( x, 2, 4, 4 ) setFillColor ("gruen", r15 ) x = x+4 r16 = CreateRect( x, 2, 4, 4 ) setFillColor ("rot", r16 ) x = x+4 r17 = CreateRect( x, 2, 4, 4 ) setFillColor ("schwarz", r17 ) x = x+4 r18 = CreateRect( x, 2, 4, 4 ) setFillColor ("gelb50", r18 ) x = x+4 r19 = CreateRect( x, 2, 4, 4 ) setFillColor ("magenta50", r19 ) x = x+4 r20 = CreateRect( x, 2, 4, 4 ) setFillColor ("cyan50", r20 )