Selecting/Querying the Output Format

The output format can be selected/queried with a parameter for the methods LlPrint[WithBox]Start(). The following list shows the different values for this parameter:

Value

Meaning

LL_PRINT_NORMAL

"Printer" output format will be default.

LL_PRINT_PREVIEW

"Preview" output format will be default.

LL_PRINT_FILE

"File" output format will be default.

LL_PRINT_EXPORT

An export module will be set as default output format. After this you could use the method Ll­Print­SetOption­String(LL_­PRNOPTSTR_­EXPORT) to specify the export module exactly.

 

You can also use LlPrint­SetOption­String(LL_­PRNOPTSTR_­EXPORT) to specify a certain output format, which will also be the default output format in Ll­PrintOptionsDialog().

Example in C++ of how to set the output format to RTF:

...

LlPrintWithBoxStart(..., LL_­PRINT_­EXPORT, ...);
LlPrint­SetOption­String(hJob, LL_­PRNOPTSTR_­EXPORT, "RTF");
LlPrintOptionsDialog(...);

If you wish to prohibit the end user from selecting the output format, you could use the option LL_­OPTIONSTR_­EXPORTS_­ALLOWED to disable the other formats. Simply specify the output format you wish to force with this option.

The end user can specify the default output format in the Designer using Project > Page Setup. The selected export module will be set by List & Label using the option LL_­PRNOPTSTR_­EXPORT. Your application should take account of this fact by determining the default output format directly or disabling this configuration opportunity in the Designer. Otherwise your end user could be confused when he selects e.g. "RTF" in the Designer, but then finds "HTML" as a default format for printing.

Example of how to take account of a selected export medium (if no selection has been set by the end user in the Designer, "Preview" will be set as default):

LlPrintGetOptionString(hJob, LL_PRNOPTSTR_EXPORT, sMedia.GetBuffer(256), 256);
sMedia.ReleaseBuffer();
if (sMedia == "") //no default setting
{
       LlPrintSetOptionString(hJob, LL_PRNOPTSTR_EXPORT, TEXT("PRV"));
}
LlPrintOptionsDialog(...);

Example of how to disable the configuration option in the Designer:

LlSetOption(hJob, LL_OPTION_SUPPORTS_PRNOPTSTR_EXPORT, FALSE);
//...
LlDefineLayout(...);

Use this option to determine which output format was selected by the end user in the LlPrintOptionsDialog().

Example showing how to query the output format:

//...
LlPrintOptionsDialog(...);
LlPrintGetOptionString(hJob, LL_­PRNOPTSTR_­EXPORT, sMedia.GetBuffer(256), 256);
sMedia.ReleaseBuffer();
//...
if (sMedia == "PRV")
{
       LlPreviewDisplay(...);
       LlPreviewDeleteFiles(...); //optional   
}