LlPrintCopyPrinterConfiguration

Syntax:

INT LlPrintCopyPrinterConfiguration (HLLJOB hJob, LPCTSTR lpszFilename, INT nFunction);

Task:

Allows saving and restoration of the printer configuration file.

Parameter:

hJob: List & Label job handle

lpszFilename: File name of the printer configuration file with file extension

nFunction: Action

Action

Meaning

LL_­PRINTERCONFIG_­SAVE

Saves the printer configuration file of the currently opened project in a file with the name lpszFilename.

LL_­PRINTERCONFIG_­RESTORE

Copies the previously saved configuration file (created with LL_PRINTERCONFIG_SAVE ) back to the current project.

Return Value:

Error code (always 0)

Hints:

It is important that LL_PRINTERCONFIG_RESTORE is called before(!) LlPrint()!

Example:

The following principle should be used for hand-made copies on a temporary printer, that is, a user can choose to temporarily change the printer using the printer dialog box, and choose multiple copies. Usually the second and following passes would print to the default printer, which is not intended.

for each copy
{
   LlPrintWithBoxStart(...)
   if (first copy)
   {
      LlPrintOptionsDialog(...);
      LlPrintCopyPrinterConfiguration(hJob, "curcfg.~~~",
         LL_PRINTERCONFIG_SAVE);
   }
   else
   {
       LlPrintCopyPrinterConfiguration(hJob, "curcfg.~~~",
         LL_PRINTERCONFIG_RESTORE);
   }
   .. LlPrint(), LlPrintFields(), ...
}

See also:

LlPrintStart, LlPrintWithBoxStart, LlSetPrinterToDefault, LlSetPrinterInPrinterFile, LlGetPrinterFromPrinterFile, LlSet­Printer­DefaultsDir