printing-marks.py revision b2c34054d4473274a1ff38ef270ad461fd75ba8a
'''
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
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")
dest="tab",
help="The selected UI-tab when OK was pressed")
'fill': 'none'}
'id': name,
'fill': 'none',
'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'
'stroke-width':'0.5',
i += 0.1
def get_selection_area(self):
sel_area = {}
#inkex.errormsg( '>> '+ id +
# ' min_x:'+ str(min_x) +
# ' min_y:'+ str(min_y) +
# ' max_x:'+ str(max_x) +
# ' max_y:'+ str(max_y) )
#inkex.errormsg('Sory, the crop to selection is a TODO feature')
#exit(1)
else :
# Get SVG document dimensions
# self.width must be replaced by self.area_x2. same to others.
#self.width = width = inkex.unittouu(svg.get('width'))
#self.height = height = inkex.unittouu(svg.attrib['height'])
# Convert parameters to user unit
# Bleed margin
# Define the new document limits
# Get middle positions
# Test if printing-marks layer existis
'//*[@id="printing-marks" and @inkscape:groupmode="layer"]',
# 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
'starTargetL', g_center)
# Right Star
'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
90,
'PrintingColourBarsL', g_center)
# Right Bars
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()