|
Printing - how to set printer properties |
Top Previous Next |
|
WPTools 5 provides you with the possibility to easily change important printer options (such as paper tray) using an easy to use property PrintParameter. During the printing the "PrintParameter" are evaluated and applied to the DEVMODE structure which is used by the printer driver. There is also the event OnSetupPrinterEvent to let you change the DEVMODE structure yourself. This feature can be disabled using the flag wpDoNotChangePrinterDefaults in property PrintParameter.PrintOptions.
The demo 'PrinterSet' shows how to:
You can use the TWPRichText method Print to print the complete document or PrintPages to print a range of documents. If you first call BeginPrint(title, pagenumber) a new printing cue is opened. For best results it is necessary to provide this function with the number of the first page. This number is 0 based. (This is necessary since the printer properties for the first page must be set before Printer.BeginDoc is executed)
If you print from different editors please make sure that the text in all this editors is formatted. If an editor is not visible call ReformatAll! To get the correct page numbering assign the total page count to WPRichText.Enviroment.CombinedPrintPageCount. You will also need to set the flag wpUsePrintPageNumber in the property PrintParameter.PrintOption of the editor which started the printing cue. The value of this -first- property will automatically be used by all the editors which are printing into the same printing cue. When printing is finished don't forget to call EndPrint!
Notes:
|