Start Event (..._PREVIEW_START/..._EXPORT_START)

Should you receive this Event, you will have to create a thread and pass the start parameters to it.

This thread creates a new List & Label- job, and causes the new job to basically lead to the execution of "a standard" print loop. In addition to the normal print loop you will have to perform the following modifications:

      Before print start set the option LL_­OPTIONSTR_­ORIGINAL­PROJECT­FILENAME to the path, as delivered by the structure.

      After starting the print job, use LlPrintSet­Option(hJob ,LL_­PRNOPT_­LASTPAGE, _nPages) to set the maximum number of pages to be printed, as passed by the callback structure.

      After each LlPrint(), check if the number of pages has exceeded this value, if so call function LlPrintAbort(). This optimization can and should also be used for normal print jobs. In this case you should not abort, but end printing normally using LlPrintEnd().

      Indicate the thread status using the provided event _hEvent of the callback structure to List & Label, once at the start and once at the end of the thread. It is important to synchronize the signaling of the event in a way that makes sure that the following call to QUEST_JOBSTATE delivers the correct state RUNNING/STOPPED. As you're signaling the event from the thread, you cannot use the thread status, but will have to use a corresponding variable. This process status has to be handled individually for each thread.

      Delete the remaining project data after printing

Additionally the following points have to be considered:

Preview

      Pass the window handle you've received in the callback structure via LlAssociatePreviewControl(hJob,hWnd,1) to List & Label before calling LlPrint(WithBox)Start, so that the print job is informed where the data should be presented.

      After completing printing, that is after LlPrintEnd() call LlAssociatePreviewControl(hJob,NULL,1), so that preview control regains control of the preview data. If a print error occurs, the last parameter has to be 0, so that the preview control is empty and not showing the last project.

Export

      Use LlPrintWithBoxStart(), so that a status box can be displayed. For the parent window handle use additionally the window handle passed by the callback structure.

      If the user selects a direct export from the Ribbon's menu, the _pszExportFormat member of the struct is set. In this case, call LlPrintSetOptionString(hJob, LL_PRNOPTSTR_EXPORT, _pszExportFormat) to preset the required export format and do not show the print options dialog (LlPrintOptionsDialog()) if _bWithoutDialog is TRUE.