Hide

SftPrintPreview/OCX 1.0 - ActiveX Print Preview Control

Display
Print

Page Management

Printing output is a simple process, rendering each page sequentially, starting at the first page. Print Preview can be quite more complicated, as a user can display the first page, then jump to the last page, a page in the middle and back to the first page. In order to display the last page, the exact layout of all pages has to be determined to arrive at the last page. Page positioning can therefore be a fairly time consuming process.

SftPrintPreview/OCX offers a very simple mechanism to optimize page positioning, allowing the application to save information after rendering each page, so restarting to produce the next page is accomplished by simply resuming using saved information.

When the RenderContent event is called with a Function argument of renderSftPrintPreview_1Page, the application renders the requested page. At the end, it can save an application defined value in the VisitedPageInfo argument of the event. This value can be a simple long value, or even an object or a pointer to an application allocated structure. In either case, the value describes the exact output position necessary to resume printing (the next page). SftPrintPreview/OCX saves all these returned values and they are accessible through the VisitedPageInfo property. The VisitedPageInfo property is an array of application-defined values, one entry for each visited page (starting at the first page, page 0). Up to VisitedPages entries are available.

If the application stores an allocated structure, it must be freed by the application. This is best done when the RenderContent event is called with a Function argument of renderSftPrintPreview_ClearCache.

When the RenderContent event is called with a Function argument of renderSftPrintPreview_1Page, the information saved for the preceding page is available in the SftPrintPreviewRenderingInfo.PreviousVisitedPageInfo member.


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.