'''
This extension will generate vector graphics printout, specifically for Windows GDI32.
Copyright (C) 2012 Alvin Penner, penner@vaxxine.com
This is a modified version of the file dxf_outlines.py by Aaron Spike, aaron@ekips.org
It will write only to the default printer.
The printing preferences dialog will be called.
In order to ensure a pure vector output, use a linewidth < 1 printer pixel
- get GdiPrintSample.zip at http://archive.msdn.microsoft.com/WindowsPrintSample
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
'''
# standard library
from ctypes import *
# local library
import inkex
import simplestyle
import simpletransform
import cubicsuperpath
exit(_("sorry, this will run only on Windows, exiting..."))
fillcolor = None # fill color
# Very NB : If the pen width is greater than 1 then the output will Not be a vector output !
if style:
if not d:
return
p = cubicsuperpath.parsePath(d)
p = [[[x, y],[x, y],[x, y]]]
p.append([[x, y],[x, y],[x, y]])
p = [p]
else:
return
if trans:
if fillcolor is not None:
return
for sub in p:
return
if trans:
if x:
if y:
# push transform
if trans or x or y:
# get referenced node
if refnode is not None:
else:
# pop transform
if trans or x or y:
if style:
return
if trans:
self.groupmat.append(simpletransform.composeTransform(self.groupmat[-1], simpletransform.parseTransform(trans)))
else:
if trans:
pcchBuffer = c_long()
exit(_("Failed to open default printer"))
# get printer properties dialog
pcchBuffer = myspool.DocumentPropertiesA(0, hPrinter, pname, byref(pDevMode), None, DM_IN_PROMPT + DM_OUT_BUFFER)
exit()
# initiallize print document
if not docname:
docname = ['New document 1']
exit() # user clicked Cancel
if __name__ == '__main__':
e = MyEffect()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99