diff --git a/docs/xml/lcl/printers.xml b/docs/xml/lcl/printers.xml
index 6caf982ef4..1b878288bd 100644
--- a/docs/xml/lcl/printers.xml
+++ b/docs/xml/lcl/printers.xml
@@ -2,1270 +2,3064 @@
+
+
+ TPrinterOrientation is an enumerated type with values that represent page orientations used for print devices and their canvases. TPrinterOrientation is the type used to implement TPrinter.Orientation and TPrinterCanvas.Orientation properties.
+
+ Not implemented in the current LCL version.
+
+ Not implemented in the current LCL version.
+
+ TPrinterCanvas is a TCanvas descendant which implements a canvas used to position, format, and output values from a TPrinter print device. The TPrinter instance which provides the capabilities for the device is passed as an argument to the constructor, and stored in the Printer property.
+
+ TPrinterCanvas provides methods which mirror the operations performed in TPrinter, like: BeginDoc, NewPage, BeginPage, EndPage and EndDoc. Methods in the canvas are called from the corresponding methods in TPrinter when its RawMode property is set to False.
+
+ A TPrinterCanvas (or descendant) class reference is used to implement the TPrinter.CanvasClass property.
+
+ HasDefaultMargins is a Boolean function used to determine if the default values are being used in the page margin properties: LeftMargin, RightMargin, TopMargin, BottomMargin. The return value is True when each of the properties contains the value 0 (zero).
+
+ HasDefaultMargins is used when getting the values for the PageHeight and PageWidth properties. When False, the page dimensions are adjusted to reserve space needed for the page margin properties.
+
+ Create is the constructor for the class instance, and calls the inherited constructor on entry. Create sets the value for the Printer property to the value in the APrinter parameter.
+
+ BeginDoc performs actions needed to start printing a document using the printer canvas. BeginDoc sets the value in the PageNumber property to 1. The NewPage method is called when each subsequent page is started.
+
+ BeginDoc is called from the TPrinter.BeginDoc method when its RawMode property is set to False.
+
+ NewPage is procedure used to perform actions needed when a new page is started. NewPage calls the BeginPage method which increments the value in PageNumber. EndPage is called when the page has been completed.
+
+ NewPage is called from the TPrinter.NewPage method.
+
+ BeginPage is a procedure used to perform actions needed when page is started for the canvas. BeginPage increments the value in the PageNumber property.
+
+ BeginPage is called from the TPrinter.BeginPage method.
+ EndPage has an empty implementation in TPrinterCanvas. EndPage is called from the TPrinter.EndPage method.
+ EndDoc is a procedure used to perform actions needed when a document has finished printing. EndDoc has an empty implementation in TPrinterCanvas.
+
+ EndDoc is called from both the EndDoc and the Abort methods in TPrinter.
+
+ Changing is an overridden procedure used to signal the OnChanging event handler (when assigned) for the canvas. Changing is overridden to ensure that an assigned Printer in the class instance has the value pfPrinting in its internal Flags. This is done by calling the CheckPrinting method in TPrinter, which can raise an EPrinter exception if it does not have the expected value in its Printing property.
+
+ Changing calls the inherited method to signal the OnChanging event handler prior to exiting from the method.
+
+ Printer is a read-only TPrinter property which contains the printer device for the canvas. Printer is used to determine the capabilities selected/enabled for the output device, such as:
+
+ The value for the property is passed as an argument to the Create constructor.
+
+ Title is a String property which contains the title for the current document. The value for the property is read from the corresponding property in Printer (when available). Setting a new value for the property causes the Title property in the assigned Printer to be updated.
+
+ PageHeight is a read-only Integer property with the size for the printable page area on the vertical axis of the page orientation. The value is expressed as the number of "Dots" on the device in Printer.
+
+ When Printer has been assigned and HasDefaultMargins is True, the PageHeight property in the device is used. Otherwise, the property value is calculated by subtracting the values in TopMargin and BottomMargin from the PaperHeight for the printer Canvas.
+
+ Use PageWidth to get size of the printable page on the horizontal axis for the page orientation.
+
+ Use PaperHeight and PaperWidth to get the dimensions for the selected paper in Printer.
+
+ PageWidth is a read-only Integer property with the size for the printable page area on the horizontal axis of the page orientation. The value is expressed as the number of "Dots" on the device in Printer.
+
+ When Printer has been assigned and HasDefaultMargins is True, the PageWidth property in the device is used. Otherwise, the property value is calculated by subtracting the values in LeftMargin and RightMargin from the PaperWidth for the printer Canvas.
+
+ Use PageHeight to get size of the printable page on the vertical axis for the page orientation.
+
+ Use PaperHeight and PaperWidth to get the dimensions for the selected paper in Printer.
+
+ PaperWidth is an Integer property which contains the width for the current paper as the number of "Dots" along its horizontal axis.
+
+ When Printer has been assigned, the Width in its PaperSize property is used as the property value. Otherwise, the existing property value is returned. If the existing value is 0 (zero), the width (in Dots) for the "A4" paper size (in portrait orientation) is used as the property value.
+
+ Use PaperHeight to get the height for the paper in Dots along its vertical axis.
+
+ PaperHeight is an Integer property which contains the height for the current paper as the number of "Dots" along its vertical axis.
+
+ When Printer has been assigned, the Height in its PaperSize property is used as the property value. Otherwise, the existing property value is returned. If the existing value is 0 (zero), the height (in Dots) for the "A4" paper size (in portrait orientation) is used as the property value.
+
+ Use PaperWidth to get the width for the paper in Dots along its horizontal axis.
+
+ PageNumber is a read-only Integer property which contains the current page number for the document being rendered to the printer canvas. The value in the property is incremented each time the BeginPage method is called for the printer canvas.
+
+ TopMargin is an Integer property which contains the size for the area between the edge of the paper and the top of the content on the page. Margin values are expressed as the number of "Dots" for the native printer resolution (YDPI). To achieve a .5in margin on a 300DPI laser printer, use the value 150.
+
+ The value for the property is normally provided by the Printer using the canvas to render document pages. When the property contains 0 (zero) and the Printer is assigned, its PaperRect property is examined to get the Top of the printable area for the paper size. Otherwise, the existing value in the property is used.
+
+ Changes to the property value are not applied to the Printer device.
+
+ Use BottomMargin for the unused area at the bottom edge of the canvas. Values in TopMargin, BottomMargin, and PaperHeight are used to calculate the PageHeight for the printer canvas.
+
+ LeftMargin is an Integer property which contains the size for the area between the edge of the paper and the left edge of the content on the page. Margin values are expressed as the number of "Dots" for the native printer resolution (XDPI). To achieve a .5in margin on a 300DPI laser printer, use the value 150.
+
+ The value for the property is normally provided by the Printer using the canvas to render document pages. When the property contains 0 (zero) and the Printer is assigned, its PaperRect property is examined to get the Left of the printable area for the paper size. Otherwise, the existing value in the property is used.
+
+ Changes to the property value are not applied to the Printer device.
+
+ Use RightMargin for the unused area at the right edge of the canvas. Values in LeftMargin, RightMargin, and PaperWidth are used to calculate the PageWidth for the printer canvas.
+
+ BottomMargin is an Integer property which contains the size for the area between the edge of the paper and the bottom of the content on the page. Margin values are expressed as the number of "Dots" for the native printer resolution (YDPI). To achieve a .5in margin on a 300DPI laser printer, use the value 150.
+
+ The value for the property is normally provided by the Printer using the canvas to render document pages. When the property contains 0 (zero) and the Printer is assigned, its PaperRect property is examined to get the Top of the printable area for the paper size. Otherwise, the existing value in the property is used.
+
+ Changes to the property value are not applied to the Printer device.
+
+ Use Topargin for the unused area at the top edge of the canvas. Values in TopMargin, BottomMargin, and PaperHeight are used to calculate the PageHeight for the printer canvas.
+
+ RightMargin is an Integer property which contains the size for the area between the edge of the paper and the right edge of the content on the page. Margin values are expressed as the number of "Dots" for the native printer resolution (XDPI). To achieve a .5in margin on a 300DPI laser printer, use the value 150.
+
+ The value for the property is normally provided by the Printer using the canvas to render document pages. When the property contains 0 (zero) and the Printer is assigned, its PaperRect property is examined to get the Left of the printable area for the paper size. Otherwise, the existing value in the property is used.
+
+ Changes to the property value are not applied to the Printer device.
+
+ Use LeftMargin for the unused area at the left edge of the canvas. Values in LeftMargin, RightMargin, and PaperWidth are used to calculate the PageWidth for the printer canvas.
+
+ Orientation is a TPrinterOrientation property which indicates the orientation for the content on a page (canvas). For example:
+
+ The value for the property is supplied by the Printer using the canvas to render document pages (when assigned). If Printer has not been assigned, an existing value in the property is used.
+
+ If the value for the property is changed, it is applied to the Printer device (when assigned).
+
+ XDPI is an Integer property which indicates the DPI (Dots per Inch) resolution for the horizontal axis on the print device.
+
+ The value for the property is normally provided by the Printer device using the canvas to render document pages. When Printer is assigned, the XDPI value in the print device is used as the property value. If Printer is not assigned, the existing value in the property is used. When the existing value is 0 (zero) or a negative number, the value 300 is assumed.
+
+ A new value assigned to the property is not applied to the Printer device.
+
+ XDPI is used to calculate the default value for the PaperWidth property.
+
+ Use YDPI for the resolution of the print device along the vertical axis.
+
+ YDPI is an Integer property which indicates the DPI (Dots per Inch) resolution for the vertical axis on the print device.
+
+ The value for the property is normally provided by the Printer device using the canvas to render document pages. When Printer is assigned, the YDPI value in the print device is used as the property value. If Printer is not assigned, the existing value in the property is used. When the existing value is 0 (zero) or a negative number, the value 300 is assumed.
+
+ A new value assigned to the property is not applied to the Printer device.
+
+ YDPI is used to calculate the default value for the PaperHeight property.
+
+ Use XDPI for the resolution of the print device along the horizontal axis.
+
- TPaperSize - the size of paper to be used for the current document with the current printer The width and length are in points; there are 72 points per inch.
+
+
+
+
+
+
+ Please note, TFilePrinterCanvas does not perform any output to the specified file. It is used as a base class for descendants which use a page description language or other printer-related technologies, like: TPostscriptPrinterCanvas, TCairoPrinterCanvas, TCocoaPrinterCanvas, et. al. +
-+ TPaperRect is a record type with members used to store the physical and working rectangles for a paper size. Coordinates values in the physical and working rectangles are expressed in Points (1/72 of an Inch). +
++ TPaperRect is the type used to implement PaperRect, PaperRectOf and GetDefaultPaperRect in TPaperSize. +
++ Contains values like: "Letter", "Legal" or "A4". Limited to 40 characters maximum. +
++ TPaperSize represents the size of the paper used for the current document with the current printer. The width and length are represented in Points (72 points per inch). +
++
++ PaperRectOfName is an indexed TPaperRect property which provides access to the rectangle for the specified paper name. aName contains the name for the requested paper. The property value contain rectangles with both the physical dimensions for the paper and the available work area for the page. +
++ If a custom paper size has been defined with the name in aName, its rectangle is used as the value for the property. Otherwise, the papers defined in the SupportedPapers property are search for the requested name. +
++ An EPrinter exception is raised when aName contains a value not located in SupportedPapers. An EPrinter exception is also raised when a rectangle cannot be determined for the specified name. +
++ Raises an EPrinter exception with the message ''The paper "%s" has no defined rectangle!''. +
++ Raises an EPrinter exception with the message 'Paper "%s" is not supported!'. +
++ GetDefaultPaperRect is an Integer function used to get a TPaperRect with the dimensions for the default paper name specified in AName. The return value contains the ordinal position in the default paper sizes defined in the class, or -1 when a default paper size with the specified name could not be located. The rectangles for the requested paper name are returned in the APaperRect parameter. +
++ The Orientation for the printer device is used to determine if the rectangle bounds must be translated to the selected orientation. No actions are needed for poPortrait or poReversePortrait orientations. For poLandscape and poReverseLandscape orientations, the value in Left and Right become the values in Top and Bottom (respectively). The values in Top and Bottom become the values in Left and Right (respectively). +
++ GetDefaultPaperRect is called from the implementation of the PaperRectOfName method. +
++ Create is the overloaded constructor for the class instance. +
++ AOwner is the TPrinter device which owns the class instance. It is used to get device capabilities such as DPI (Dots per Inch), and to calculate the page rectangle for the paper size. An exception is raised if AOwner has not been assigned (contains Nil). +
++ Create calls the inherited constructor. +
++ Create allocates resources and initializes internal members used in the class instance. +
++ Destroy is the overridden destructor for the class instance. Destroy frees resources allocated to internal members in the class instance, and calls the inherited destructor. +
+- RawMode - true if printer operates in Raw Mode (as opposed to PostScript or some other page description language)
-If Raw Mode is being used, text is sent directly to the printer device without formatting, and the Canvas is not used for setting up the pages
+ TPrinter is a TObject descendant which defines an API for a printer device. + ++ TPrinter provides properties and methods used to select, configure, and control the printer device. Most of the methods are declared as virtual, and can be overridden in descendent classes which implement specific features like: page description languages, networking protocols, support for graphics libraries, etc. +
++ TPrinter uses a Canvas to position, format, and render output for the print device. A TPrinterCanvas class is provided which extends the familiar TCanvas class with features for printer-specific usage. The CanvasClass property allows the printer to create instances of TPrinterCanvas or descendent classes. +
++ TPrinter also provides a RawMode property which indicates that output does not use formatting or a page description language, and bypasses use of the Canvas class. Think of this as "Dot Matrix Mode". +
++ Properties are provided which allow the printer device to be configure its output resolution, paper selection, page margins, etc. Methods are provided to perform printer control when processing print jobs, documents, and pages. +
+
+ TPrinter is a base class. Do not create instances of TPrinter; an exception is raised when the ClassType for the class instance is TPrinter (and not one of its descendants). Use one of the descendants provided in the
+ SelectCurrentPrinterOrDefault ensures that a valid print device is selected. The default printer (the first device in Printers) is used when PrinterIndex has not been assigned and the number of devices in Printers is not 0 + (zero). +
++ SelectCurrentPrinterOrDefault is called from the implementation of the BeginDoc method, and when the list in Printers is loaded in the GetPrinters method. It is also called when the paper size for a print device is validated in the TPaperSize.CheckSupportedPapers method. +
++ DoBeginDoc is a virtual procedure which performs actions needed when printing is started for a document. DoBeginDoc is called from the BeginDoc method, and occurs after checking the printer status and updating values in PrinterFlags. When RawMode is False, the Canvas has already been refreshed and its BeginDoc method has been called. +
++ DoNewPage is a virtual procedure used to perform actions needed to start a new page for the print device. DoNewPage is called from the NewPage method when an overridden method has been provided in the class implementation. It occurs after checking the printer status and incrementing the value in PageNumber. +
++ DoBeginPage is a virtual procedure used to perform actions needed to begin a page for the selected print device. DoBeginPage is called from the BeginPage method, and occurs after checking the printer status and incrementing the PageNumber. +
++ DoEndPage is a virtual procedure used to perform actions needed to end the current page for the print device. DoEndPage is called from the EndPage method, and occurs after synchronizing the printer canvas when RawMode is False. +
++ DoEndDoc is a vitual method used to finishing printing the current document. aAborted is True if printing has been halted by calling the Abort method. +
++ DoAbort is a virutal procedure used to perform actions needed to abort printing for the current document. DoAbort is called from the Abort method, and occurs after checking the printer status and before setting values in PrinterFlags. +
++ DoResetPrintersList is a virtual method which performs actions needed to reset the status for the list of available devices in the Printers property. DoResetPrintersList removes the value pfPrintersValid from the PrinterFlags property. +
++ DoResetPrintersList is called from the Refresh method, and occurs prior to clearing and re-populating values in the Printers property. It is also called from the DoDestroy method when the class instance is freed. +
++ DoResetFontsList is a virtual method used to perform actions needed to reset the list of Fonts for the selected print device. DoResetFontsList clears any values stored in the Fonts property (when assigned). +
++ DoResetFontsList is called from the Refresh method, and from DoDestroy when the class instance is freed. +
++ DoEnumPrinters is a virtual procedure used to performs actions needed to populate the list in Lst with the printers available in the class instance. DoEnumPrinters has an empty implementation in TPrinter. It must be overridden in a descendent class to perform the actions required for the implementation. +
++ DoEnumPrinters is called from the GetPrinters method, and passes the member for the Printers property as the list storage for the method. +
++ DoEnumFonts is a virtual method used to perform actions needed to populate the specified list with font names supported for the selected print device. DoEnumFonts is called from the GetFonts method when the Fonts property is empty. +
++ DoEnumPapers has an empty implementation in TPrinter; it must be overridden in a descendent class to implement the functionality. +
++ DoEnumBins has an empty implementation in TPrinter; it must be overridden in a descendent class to implement the functionality. +
++ DoInitialization is a method used to initialize the class instance after the list of supported Printers has been retrieved. DoInitialization has an empty implementation in TPrinter, and must overridden in a descendent class to implement the functionality. +
++ DoInitialization is called from the GetPrinters method, and occurs only once when the PrinterFlags does NOT include the values pfPrintersValid and pfDestroying. When called, the DoEnumPrinters method has successfully completed and the default printer has been selected using the SelectCurrentPrinterOrDefault method. +
++ DoSetPrinter is a virtual Integer function used to perform actions needed to set the selected printer to the name specified in aName. The return value contains the ordinal position in Printers where the name is located, or -1 when the specified name was not found. +
++ DoSetPrinter is called from the SetPrinter method. +
++ DoGetCopies is a virtual Integer function used to perform actions needed to get the number of copies currently set for the print device. DoGetCopies is called when the value for the Copies property is read. +
++ DoSetCopies is a virtual procedure used to perform actions needed to set the number of copies for each page printed on the device. DoSetCopies is called when a new value is assigned to the Copies property. +
++ DoGetOrientation is a virtual TPrinterOrientation function used to perform actions needed to get the page orientation for the print device. DoGetOrientation is called when the value for the Orientation property is retrieved, and provides the value used in the property. +
++ DoSetOrientation is a virtual procedure used to perform actions needed to set the page orientation for a print device. AValue is a value from the TPrinterOrientation enumeration applied to the print device. See TPrinterOrientation for more information about the enumeration values and their meanings. DoSetOrientation is called when a new value is assigned to the Orientation property. +
++ DoGetDefaultPaperName is a virtual String function which performs action needed to get the name for the default paper on the selected print device. The return value contains the name for the default paper, such as: "Letter", "Legal", or "A4". DoGetDefaultPaperName is called when the value for the TPaperSize.DefaultPaperName property is read. +
++ DoGetPaperName is a virtual String function which performs action needed to get the selected paper name for the current printer. DoGetPaperName is called when the value for the TPaperSize.PaperName property in the printer is read. +
++ DoSetPaperName performs actions needed to set the paper for the current printer to the specified name. DoSetPaperName is called when the paper name is assigned to the PaperName property in PaperSize. +
++ DoGetPaperRect is an Integer function used to get the dimensions (or rectangle) for the specified paper name. The return value indicates whether the rectangle represents the margins or the actual work area for the specified paper name. +
++ DoGetPrinterState returns the printer state. DoGetPrinterState is declared as a virtual method so that it may be overridden in a descendent class to perform the actions needed to determine the printer state for the implementation. +
++ DoDestroy is a virtual procedure used to perform actions needed when the print device is freed. In TPrinter, the following actions are performed: +
++ DoDestroy is normally overridden in a descendent class to perform additional actions required for the implementation. +
++ DoDestroy is called from the Destroy destructor. +
++ CheckRawMode is a procedure used to ensure that the RawMode property contains the specified Value. If RawMode does not have the requested value, an EPrinter exception is raised. Msg contains the message text for the exception. When Msg is not specified, or contains an empty strng (''), a default message is used: +
++ CheckRawMode is called when getting the value for the Canvas property. +
++ Raises an EPrinter exception when RawMode does not contain the required value. +
++ RawModeChanging is a virtual procedure used to perform actions needed when a new value is assigned for the RawMode property. RawModeChanging is called from the SetRawMode method, and occurs after checking the value in Printing and before changing values in PrinterFlags. It is useful when switching from RawMode (which does not require a printer Canvas) to using a page description language like Postscript (which requires a specialized printer Canvas). +
++ PrinterSelected is a virtual procedure used to perform actions needed when a new printer has been selected in the class instance. PrinterSelected is called from the SetPrinter method to signal that a printer has been successfully selected from the list of Printers, and that the value in PrinterIndex has been updated. +
++ PrinterFlags is a TPrinterFlags property which contains the flags currently enabled for a print device. Flag values are removed from PrinterFlags when they are disabled. +
++ Create is the constructor for the class instance, and calls the inherited constructor on entry. +
++ Create sets the value in PrinterIndex to -1 which indicates that the default printer in Printers should be used. +
++ Create stores an unassigned value (Nil) in the Canvas, PaperSize, and Bins properties. The Title property is set to an empty String (''). +
++ Raises an exception with the message 'TPrinter is an abstract base class.' when TPrinter is the ClassType for the new instance. +
++ Destroy is the overridden destructor for the class instance. Destroy updates the status flags for the device to include the value pfDestroying. It calls the DoDestroy method to cancel an active print job and free resources allocated in the class instance. Destroy calls the inherited destructor prior to exit. +
++ Abort is a procedure used to terminate printing of the current document (when active). Aborts calls CheckPrinting to ensure that Printing contains True. CheckPrinting raises an exception if Abort is called when BeginDoc has not been called. +
++ Abort calls the DoAbort method to perform any actions needed for the class implementation. +
++ Abort updates the PrinterFlags property to include the value pfAborted, and calls the EndDoc method to end printing for the current document. +
++ BeginDoc is a procedure used to start printing for the current document. BeginDoc calls CheckPrinting to ensure that the print device has not already started printing for the document. CheckPrinting raises an exception if the value in Printing is True. +
++ BeginDoc calls SelectCurrentPrinterOrDefault to ensure a valid printer is selected for the class instance. If the current selection is invalid, the "default" printer is selected. The default printer is the first one in Printers. +
++ BeginDoc updates PrinterFlags to include the value pfPrinting, and removes the value pfAborted (if present). The PageNumber property is set to 1 (one) for the newly started printing operation. +
++ BeginDoc uses the value in RawMode to determine if a printer canvas is in used for the class instance. When RawMode is False, a TPrinterCanvas instance exists in Canvas. Its Refresh method is called, and the BeginDoc method in the printer canvas is called to synchronize the canvas. The value in YDPI is assigned to the PPI (Pixels per Inch) setting for the canvas font. No actions are performed for the printer canvas when RawMode is True. +
++ BeginDoc calls the DoBeginDoc method to perform any actions specific to the current class implementation. BeginPage is called to increment the PageNumber for the print device. +
++ Use EndDoc to finish printing for the current document. +
++ EndDoc is a procedure used to end printing for the current document. EndDoc calls CheckPrinting to ensure that Printing contains True. An exception is raised in CheckPrinting if Printing contains False. +
++ EndDoc calls the EndPage method to synchronize the printer Canvas (when used) and to perform any actions required for the class implementation. The EndDoc method for the Canvas is called when RawMode is False. +
++ DoEndDoc is called using the value in Aborted as an argument, and allows any actions needed for the class implementation to be performed. +
++ EndDoc updates values in the PrinterFlags property to reflect the current printer and document state. The values pfPrinting and pfAborted are removed from PrinterFlags. +
++ The value in the PageNumber is reset to 0 (zero). +
++ Use BeginDoc to start printing a document. Use Abort to abandon printing the current document. +
++ NewPage is a procedure used to create a new page for the document currently printing on the selected device. +
++ NewPage checks the current class instance to see if it is a TPrinter descendant with an overriden DoNewPage method. If it has not been overridden, the following methods are called: +
++ When it has been overridden, the following actions are performed: +
++ BeginPage is a procedure used to perform action when a page is started on the print device. BeginPage calls CheckPrinting to ensure that Printing contains True. An exception is raised in CheckPrinting when Printing contains False. +
++ BeginPage increments the value in the PageNumber property. When RawMode is False, the BeginPage method in Canvas is called to synchronize the printer canvas. +
++ BeginPage calls the DoBeginPage method to perform any actions needed for the class implementation. +
++ BeginPage is called from the BeginDoc method, and from the NewPage method when DoNewPage has not been overridden. +
++ EndPage is a procedure used to end the current page for the document. +
++ EndPage uses the value in RawMode to determine if a printer canvas is used. When RawMode is False, the EndPage method in Canvas is called to synchronize the printer canvas. +
++ EndPage calls the DoEndPage method to perform actions needed for the class implementation. +
++ Refresh performs actions needed to update the list or printers or fonts when the SetPrinter method is used to change the selected printer, such as: +
++ PrinterIndex is set to -1 if the previous printer cannot be re-selected after loading values in Printers. The selects the default printer when the previous selection becomes unavailable. +
++ aName contains the name of the printer to use as the active print device. It can contain a "wild-card" value '*' which selects the default printer (the first one in the list of available printers) as the active print device. +
++ Write is an Boolean function used to write the specified values to the printer device. Overloaded variants of the method allow the values to be specified as an AnsiString data type or an untyped buffer. +
++ Buffer is the untyped buffer written in the method. +
++ Count indicates the number of bytes in Buffer to use in the write operation. +
++ Written contains the actual number of bytes handled in the write operation. +
++ S is the AnsiString value written in the method. +
++ The return value is True when the specified values are successfully written in the method. +
++ PrinterIndex is an Integer property which contains the ordinal position in Printers for the selected print device. The default value for the property is -1, and indicates that a print device has not been selected and that the default printer should be used. (Nota bene: The default printer is the first one in the Printers property). +
++ Setting a new value in PrinterIndex causes the CheckPrinting method to be called to ensure that the value in Printing is False. An exception is raised in CheckPrinting when Printing is set to True. Set the value for the property prior to calling the BeginDoc method. +
++ An exception may also be raised for the following conditions: +
++ The SetPrinter method is called to make the named device the selected print device. DoResetFontsList is called to reload the values in the Fonts property. +
++ PrinterName is a read-only String property which contains the name for the currently selected print device. The property value is retrieved from Printers using the value in PrinterIndex. When PrinterIndex contains a negative value, an empty string ('') is returned as the value for the property. +
++ Use SetPrinter to select a print device with a given name in Printers. Or, assign a new value to the PrinterIndex property. +
++ PaperSize is a read-only TPaperSize property which contains information about papers names and sizes available and/or selected for the print device. PaperSize is used to get a rectangle with the physical size of the paper, or its working area. The rectangle is used to calculate the vales for the PageHeight and PageWidth properties. +
++ PaperSize always contains common page sizes like "Letter", "Legal" and "A4". Other papers may be available depending on the printer selection or the implementation for the print device in a descendent class. +
++ Orientation is a TPrinterOrientation property which indicates the orientation for the page content on its paper. For example: +
++ For TPrinter, the property value is always poPortrait. The DoGetOrientation and DoSetOrientation methods are called when the property value is read/written. They are declared as virtual methods, and must be overridden in a descendent class to perform actions specific to the implementation. +
++ Orientation determines how the rectangle coordinate values in a paper size are interpreted. The paper size gives it coordinates in a portrait orientation. When one of the Landscape orientations is used, the values must be translated (or rotated) to reflection the page orientation. +
++ PrinterState is a read-only TPrinterState property which contains a value with the current state for the print device. See TPrinterState for the enumeration values and their meanings. +
++ The read access specifier for the property is declared as a virtual method. It may be overridden in a descendent class to perform actions needed to determine the printer state for the implementation. +
++ In TPrinter, the value for the property is always psNoDefine. +
++ Copies is an Integer property which indicates the number of times a page is duplicated during the printing process. Copies is one the TPrinterCapabilities which may be supported for a print device. +
++ In TPrinter, Copies always contains the value 1. The DoGetCopies and DoSetCopies methods are used to provide support for the printer capability. They are declared as virtual methods, and must be overridden in a descendent class to implement the feature. +
++ Printers is a read-only TStrings property which contains the names for print devices that can be selected in the class instance. By convention, the first print device in Printers is the "default" printer. +
++ Values in Printers are retrieved and stored using the DoEnumPrinters method. This method is called when the property value is retrieved and PrinterFlags does not include the pfPrintersValid flag. It is normally called only once - unless the Refresh or DoResetPrintersList methods are called. +
++ Printers is used in the SetPrinter method to validate the name for the selected printer device. Its Count property is used in other methods to ensure that valid printer devices exist in the class instance. +
++ Use SetPrinter to select a print device by its name. Use PrinterIndex to change the selected device to the printer at the specified ordinal position in Printers. +
++ FileName is a String property which contains the path and file name on the local file system where output from the print device is stored. +
++ Fonts is a read-only TStrings property which contains a list of font names available for the selected print device. Values in Fonts are retrieved and stored using the DoEnumFonts method. It is called when the number of items in Fonts is 0, and when Refresh or DoResetFontsList is called. +
++ Canvas is a read-only TCanvas property which provides properties and methods used to position and format content on a page. +
++ In TPrinter, and descendants, a printer-aware class derived from TCanvas is used: TPrinterCanvas. A descendent class may also introduce its own canvas class with specific features for the page description language, or printer-related technology used in its implementation. The CanvasClass property identifies the class reference used to create the member for the Canvas property. +
++ Canvas is used in methods like BeginDoc, EndDoc, BeginPage, and EndPage to synchronized the rendering surface to the current state for the print device. Canvas is used only when RawMode is set to False. +
++ CanvasClass is a TPrinterCanvasRef property which contains the class reference used to create new instances of the class for the Canvas property. In TPrinter, the TPrinterCanvas class is used for the Canvas property. In a descendent class, a different printer canvas may be needed. CanvasClass allows the descendant to determine the correct class type in its DoGetDefaultCanvasClass method. The property value is always returns Nil when RawMode is set to True. +
++ CanvasClass is used in the read access specifier for the Canvas property to create a new instance of the class reference and assign it to the Canvas member (when needed). +
++ PageHeight is a read-only Integer property which contains the usable height for the selected paper size as a number of "Dots" for the native printer resolution. +
++ PageHeight uses the PaperSize property to retrieve the work area for the selected paper size. The property value contains the difference between the Bottom and Top coordinates in the work area rectangle. +
++ The property value is 0 (zero) when the Printers property is empty. You cannot access a selected paper size without a selected printer. +
++ PageHeight is used to derive the page height in TPrinterCanvas when a TPrinter instance has been assigned. +
++ PageWidth is a read-only Integer property which contains the usable width for the selected paper size as a number of "Dots" for the native printer resolution. +
++ PageWidth uses the PaperSize property to retrieve the work area for the selected paper size. The property value contains the difference between the Right and Left coordinates in the work area rectangle. +
++ The property value is 0 (zero) when the Printers property is empty. You cannot access a selected paper size without a selected printer. +
++ PageWidth is used to derive the page width in TPrinterCanvas when a TPrinter instance has been assigned. +
++ PageNumber is a read-only Integer property which contains the current page number in the document being printed to the device. The value in the property is maintained in methods which process the document or its pages, like: BeginDoc, EndDoc, NewPage and BeginPage. +
++ Aborted is a read-only Boolean property which indicates if the current print job has been terminated. The value for the property is determined by examining the values in the PrinterFlags property. When PrinterFlags includes the value pfAborted, the property value is True. +
++ The status value is included in PrinterFlags when the Abort method is called. It is removed from PrinterFlags when the BeginDoc method is called. +
++ Printing is a read-only Boolean property which indicates if the device is currently printing a document. The value for the property is determined by examining the PrinterFlags for the device. When PrinterFlags includes the value pfPrinting, the property value is True. +
++ The status value is included in PrinterFlags when the BeginDoc method is called, and removed from PrinterFlags when the EndDoc method is called. +
++ Use Abort to halt the current printing process. +
++ Title is a String property which contains the title of the current document for the print device. The default value assigned in the constructor is an empty string (''). +
++ Set the value in Title prior to calling the BeginDoc method. It may also be assigned using the Title property in the Canvas (TPrinterCanvas) for the print device. In this case, the value is applied to the print device as well. +
++ PrinterType is a TPrinterType property which indicates whether the print device is locally attached, or network enabled. In TPrinter, the value for the property is always ptLocal. A descendent class (like TCUPSPrinter) may return another value from the TPrinterType enumeration. +
++ CanPrint is a read-only Boolean property which indicates if the print device is enabled and ready to print. +
++ CanRenderCopies is a read-only Boolean property which indicates if the print device can print more than one copy of pages in the document. The property value is True when the print device includes the pcCopies printer capability. +
++ XDPI is a read-only Integer property that contains the horizontal resolution for the print device in DPI (Dots per Inch). The value in XDPI is passed to the Canvas for the print device, and used to determine the paper width for the printer canvas. +
++ YDPI is a read-only Integer property that contains the vertical resolution for the print device in DPI (Dots per Inch). The value in YDPI is passed to the Canvas for the print device, and used to determine the paper width for the printer canvas and the PPI (Pixels per Inch) value for its Font. +
++ Set RawMode to True if the printer operates in Raw Mode (as opposed to PostScript or some other page description language). +
++ When RawMode is True, text is sent directly to the printer device without formatting and the Canvas is not used to layout or position content on the page. +
++ DefaultBinName is a read-only String property which contains the name for the defauilt Paper Bin on the selected print device. The value for the property is retrieved using the DoGetDefaultBinName method. +
++ DefaultBinName is used in the implementation of the RestoreDefaultBin method. +
++ Use BinName to read or write the value for the selected paper bin on the print device. +
++ BinName is a String property with the name for the Paper Bin selected for the print device. BinName contains one of the values found in the SupportedBins property. +
++ The value for the property is retrieved using the DoGetBinName method. Setting a new value for the property requires Printing to be set to False; an exception is raised in CheckPrinting when Printing contains True. The property value is applied using the DoSetBinName method. +
++ SupportedBins is a read-only TStrings property which contains the names for the Paper Bins supported on the selected print device. The value for the property is retrieved in the GetBins method by calling DoEnumBins. +
++ Assign a value from SupportedBins to the BinName property to select a specific paper bin. +
++ Printer is a TPrinter variable which can be used to store a unit global printer instance. The value in Printer may contain a derived class instance which implements a specific page description language or printer-related technologies like CUPS. Its value may be assigned in classes which have a specific implementation for a printer device. The value in Printer is freed (when assigned) during finalization of the unit. +
+
+ Additional printer types and OS-specific implementations are available in the