<< Click to Display Table of Contents >> PrintOptions |
[Windows platform only; not supported by PHP and the Community Edition]
Allows to set several print options. This preset is also active if the user pushes the print-button in the toolbar, or if the method SetupPrinter() is called.
property PrintOptions [long] VPE.PrintOptions
write; runtime only
Possible Values:
a combination of the following values:
ActiveX / VCL |
Value |
Enum |
Comment |
PRINT_ALL |
0 |
PrintAll |
print all pages |
PRINT_EVEN |
1 |
PrintEven |
print only even pages |
PRINT_ODD |
2 |
PrintOdd |
print only odd pages |
PRINT_NOABORTDLG |
4 |
NoAbortDialog |
show no abort / progress dialog during printing |
PRINT_NO_AUTO_PAGE_DIMS |
16 |
NoAutoPageDims |
VPE shall not instruct the printer to use the page dimensions of the currently printed page |
Default:
PRINT_ALL
for the VpeWebControl it is: PrintAll + NoAbortDialog, because it is not meaningful to show a progress / abort dialog on a server.
Example:
The several different options can be set by adding the values of each flag. When you assign a new value to PrintOptions, any previous settings will be overwritten:
ActiveX / VCL:
Doc.PrintOptions = PRINT_EVEN
print only even numbered pages
Doc.PrintOptions = PRINT_ODD + PRINT_NOABORTDLG
print only odd numbered pages and do not show the print-progress dialog
Doc.PrintOptions = PRINT_ALL + PRINT_NOABORTDLG + PRINT_NO_AUTO_PAGE_DIMS
print all pages, do not show the print-progress dialog, do not instruct the printer to use the page dimensions of the currently printed page
Doc.PrintOptions = PRINT_ALL
reset to default
.NET:
Doc.PrintOptions = PrintOptions.PrintEven
print only even numbered pages
Doc.PrintOptions = PrintOptions.PrintOdd + PrintOptions.NoAbortDialog
print only odd numbered pages and do not show the print-progress dialog
Doc.PrintOptions = PrintOptions.PrintAll + PrintOptions.NoAbortDialog + PrintOptions.NoAutoPageDims
print all pages, do not show the print-progress dialog, do not instruct the printer to use the page dimensions of the currently printed page
Doc.PrintOptions = PrintOptions.PrintAll
reset to default
C#:
Doc.PrintOptions = PrintOptions.PrintEven
print only even numbered pages
Doc.PrintOptions = PrintOptions.PrintOdd | PrintOptions.NoAbortDialog
print only odd numbered pages and do not show the print-progress dialog
Doc.PrintOptions = PrintOptions.PrintAll | PrintOptions.NoAbortDialog | PrintOptions.NoAutoPageDims
print all pages, do not show the print-progress dialog, do not instruct the printer to use the page dimensions of the currently printed page
Doc.PrintOptions = PrintOptions.PrintAll
reset to default
Remarks:
PRINT_NO_AUTO_PAGE_DIMS:
By default, VPE instructs the printer during printing, to switch the paper dimensions automatically according to the page dimensions of the VPE Document's currently printed page. Many printers can react on this and choose automatically the right paper from a different paper input bin. If you want to stop VPE from this automatism, you can specify the flag PRINT_NO_AUTO_PAGE_DIMS for this property.
Use PRINT_NO_AUTO_PAGE_DIMS also, if you require that the SetupPrinter() method retrieves the settings for the page dimensions from a PRS file.
It has been reported, that some very few printer drivers have a bug and do not print in duplex mode, unless you use PRINT_NO_AUTO_PAGE_DIMS.
In order to let the printer accept the automatic selection of user defined page formats (i.e. you are not specifying PRINT_NO_AUTO_PAGE_DIMS), it might be necessary to define a form of the desired page format.
Example: with "Start Menu | Settings | Printers" the window with the installed printers will appear. Right-click on a blank area of the window and choose "Server Properties" from the pop-up menu. In the upcoming dialog, define a custom form of the desired dimensions. For example name it "Test" and set the width to 760 and height to 1280.
In your source code, select the printer and the desired page format like this:
VPE.Device = "Epson LQ-550"
VPE.PageWidth = 760
VPE.PageHeight = 1280
That's it.