Type: Class
Abstract base class for PdfTextPrinter, Win32TextPrinter, PlainTextPrinter, HtmlTextPrinter.lineWidth(), margin, pageWidth and pageHeight are expressed in 'logical units' or implementor's unit, that is, a unit chosen by the implementing class. For example Win32TextPrinter uses twips as unit, PdfTextPrinter uses points (1/72 of an inch), the same unit as reportlab.lib.units. The base class doesn't care about the real value of these parameters.
- length2i() (method) — Convert a length to implementor's unit.
- writeln() (method) — Print a line of text after parsing it.
- setCpi() (method) — Set font size by specifying characters per inch.
- lineWidth() (method) — Return the width (in implementor's unit) available for text.
- insertImage() (method) — prints an image.
- ratio_size2leading (variable) — Ratio used to calculate the line spacing (leading) for a known font size, using the formula «leading = fontsize * ratio_size2leading».
- drawDebugRaster() (method)
Refering articles:
- Specifying page margin in TextPrinter() (05.02.07) — The margin parameter for TextPrinter.__init__() is now supposed to be a string containing a length that will be converted to implementor's unit using length2i().
- absolute image position for TextPrinter (feature 28.11.06) more
- Font height/width ratio with Win32TextPrinter (Fixed bugs 22.09.06) — Win32TextPrinter.setCpi() rendered the characters a little bit bigger than they should. more
- TextPrinters now use Session.debug() (11.08.06) — prnprint.py now displays debugging info if called with -vv. I am going to use this to explore the mysterious HP LaserJet 1200 phenomen. more
- Setting devmode.Orientation when creating the DC (09.08.06) — After reading Chris' article (newcenturycomputers.net/projects/pythonicwindowsprinting.html), I decided to try whether this method is a solution for my problem Landscape printing with Win32TextPrinter without requiring SetWorldTransform(). more
- Working on TextPrinter (code changes 11.04.05) — TextPrinter.getWidth() returned the number of characters per line. I renamed it to getCpl(). Using ESC I to insert images is now deprecated. Use the new syntax #exec self.insertImage(...) instead. more
- misc (code changes 06.04.05) — Working on TextPrinter and winprn and prnprint use wrong character size after setLpi(). more