def test01(self): spoolFile = self.addTempFile("77.ps", showOutput=True) d = winprn.Win32TextPrinter( #config.win32.get('postscript_printer'), self.runtests.options.postscript_printer, spoolFile) self.doit(d) spoolFile = self.addTempFile("77L.ps", showOutput=True) d = winprn.Win32TextPrinter( #config.win32.get('postscript_printer'), self.runtests.options.postscript_printer, spoolFile) d.setOrientationLandscape() d.writeln("And now the same in landscape. ") d.writeln() self.doit(d)
def test01(self): from lino.textprinter import winprn spoolFile = self.addTempFile("4.ps",showOutput=True) d = winprn.Win32TextPrinter( #config.win32.get('postscript_printer'), self.runtests.options.postscript_printer, spoolFile) self.doit(d)
def test01(self): spoolFile = self.addTempFile("1.ps",showOutput=True) d = winprn.Win32TextPrinter( #config.win32.get('postscript_printer'), self.runtests.options.postscript_printer, spoolFile) self.doit(d) spoolFile = self.addTempFile("1.pdf",showOutput=True) d = pdfprn.PdfTextPrinter(spoolFile) self.doit(d)
def main(): spoolFile = r"tmp.ps" d = winprn.Win32TextPrinter("Lexmark Optra PS", spoolFile, coding="cp850") d.writeln("--- File 2a.prn:---") d.readfile("2a.prn",coding="cp850") d.writeln("--- eof 2a.prn---") d.writeln("--- File 2b.prn:---") d.readfile("2b.prn",coding="cp850") d.writeln("--- eof 2b.prn---") d.writeln("Here is some more text.") d.writeln("Ännchen Müller machte große Augen.") d.write("And here") d.write(" is some") d.write(" frag") d.writeln("mented text.") d.drawDebugRaster() d.endDoc()
def run(self): if len(self.args) == 0: raise UsageError("no arguments specified") if self.options.copies < 0: raise UsageError("wrong value for --copies") for inputfile in self.args: for cp in range(self.options.copies): d = winprn.Win32TextPrinter( self.options.printerName, self.options.spoolFile, #useWorldTransform=self.options.useWorldTransform, encoding=self.options.encoding, fontName=self.options.fontName, fontWeights=self.options.fontWeights, cpi=self.options.fontSize, session=self) #charset=winprn.OEM_CHARSET) d.readfile(inputfile) d.close() if d.page == 1: self.notice("%s : 1 page has been printed", inputfile) else: self.notice("%s : %d pages have been printed", inputfile, d.page)