VpeWritePrinterSetup

<< Click to Display Table of Contents >>

Navigation:  Device Control Properties >

VpeWritePrinterSetup

Previous pageReturn to chapter overviewNext page

[Windows platform only; not supported by the Community Edition]

Writes the current printer setup to file for persistent storage. This file is 100% identical to the file that is generated by VpeSetupPrinter().

int VpeWritePrinterSetup(

VpeHandle hDoc,

LPCSTR file_name

)

VpeHandle hDoc

Document Handle

LPCSTR file_name

the name of the file, the setup is written to

Returns:

Value

Description

True

success

False

failure

Remarks:

In case of an error, LastError is set to VERR_COMMON.

 

For standardization, Printer Setup Files created with VPE should have the suffix ".PRS"

 

Win16 and Win32 printer setup files generated by VPE are NOT identically and therefore can NOT be created on one platform and be used on another platform.  VPE detects such a situation and will set LastError = VERR_COMMON.

 

The setup files contain private device driver data. This has the big advantage, that special settings, options and features of a specific printer can be set and stored to file (for example some printers offer to select an output paper bin, which is not known by the Win API). Therefore, the use of the method VpeSetupPrinter() has some advantages, as the settings a user may make in the printer specific setup dialogs are stored with the file.

But - because of the private driver data - if the user replaces the printer by another model (or manufacturer) or possibly if just the driver version is changed, it might be necessary to delete the setup file(s) and to newly create them.