printing-marks.py revision b4da8c581c686df305a1ba372f1c52066328b980
'''
This extension allows you to draw crop, registration and other
printing marks in Inkscape.
Authors:
Nicolas Dufour - Association Inkscape-fr
Aurelio A. Heckert <aurium(a)gmail.com>
Copyright (C) 2008 Authors
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
# Default parameters
stroke_width = 0.25
dest="tab")
help="Apply crop marks to...")
help="Draw crop Marks?")
help="Draw Bleed Marks?")
help="Draw Registration Marks?")
help="Draw Star Target?")
help="Draw Colour Bars?")
help="Draw Page Information?")
help="Draw measurment")
help="Offset")
help="Bleed Top Size")
help="Bleed Bottom Size")
help="Bleed Left Size")
help="Bleed Right Size")
'id': name,
'stroke-miterlimit': '4', 'stroke-dasharray': '4, 2, 1, 2',
'stroke-dashoffset': '0' }
'id': name,
'fill':'none'}
step = r
'd': 'm' +\
' z',
d = ' M 0,0'
i = 0
d += ' L 0,0 ' +\
'd':d}
'id':name,
{'c':'r', 'stroke':'#0FF', 'x':0, 'y':0},
{'c':'g', 'stroke':'#F0F', 'x':(l*11)+1, 'y':-(l+1)},
{'c':'b', 'stroke':'#FF0', 'x':(l*11)+1, 'y':0}
]:
i = 0
while i <= 1:
cr = '255'
cg = '255'
cb = '255'
i += 0.1
# Get SVG document dimensions
# Convert parameters to user unit
# Bleed margin
# Define the new document limits
# Create a new layer
# Crop Mark
# Create a group for Crop Mark
'id':'CropMarks'}
# Top left Mark
'cropTL1', g_crops)
'cropTL2', g_crops)
# Top right Mark
'cropTR1', g_crops)
'cropTR2', g_crops)
# Bottom left Mark
'cropBL1', g_crops)
'cropBL2', g_crops)
# Bottom right Mark
'cropBR1', g_crops)
'cropBR2', g_crops)
# Bleed Mark
# Create a group for Bleed Mark
'id':'BleedMarks'}
# Top left Mark
'bleedTL1', g_bleed)
'bleedTL2', g_bleed)
# Top right Mark
'bleedTR1', g_bleed)
'bleedTR2', g_bleed)
# Bottom left Mark
'bleedBL1', g_bleed)
'bleedBL2', g_bleed)
# Bottom right Mark
'bleedBR1', g_bleed)
'bleedBR2', g_bleed)
# Registration Mark
# Create a group for Registration Mark
'id':'RegistrationMarks'}
# Left Mark
# Right Mark
# Top Mark
# Bottom Mark
# Star Target
# Create a group for Star Target
'id':'StarTarget'}
# Left Star
(height/2),
'starTargetL', g_center)
# Right Star
(height/2),
'starTargetR', g_center)
else :
# Top Star
'starTargetT', g_center)
# Bottom Star
'starTargetB', g_center)
# Colour Bars
# Create a group for Colour Bars
'id':'PrintingColourBars'}
# Left Bars
height/2,
90,
'PrintingColourBarsL', g_center)
# Right Bars
height/2,
90,
'PrintingColourBarsR', g_center)
else :
# Top Bars
0,
'PrintingColourBarsT', g_center)
# Bottom Bars
0,
'PrintingColourBarsB', g_center)
# Page Information
# Create a group for Page Information
'id':'PageInformation'}
txt_attribs = {'style':'font-size:12px;font-style:normal;font-weight:normal;fill:#000000;font-family:Bitstream Vera Sans,sans-serif;text-anchor:middle;text-align:center',
'x' +\
if __name__ == '__main__':
e = Printing_Marks()
e.affect()