print_win32_vector.py revision 34ec627bf89be7c765a437fe5aaf5f9df1346676
'''
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
'''
from ctypes import *
import gettext
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