ComponentOne VSView 8.0
VSPrinter Utilities - VPUtil

VSPrint 8 includes a set of utilities provided in source code form. The utilities are implemented in files VPUtil.BAS (for Visual Basic users) and VPUtil.cpp (for Visual C++users.)

The utilities include the following routines:

VPSaveState and VPRestoreState: these functions save and restore the current state of the VSPrintercontrol. They are useful when you want to apply style changes to the document, and restore its previous state when you are done. The functions implement a "state-stack", so you can nest calls to the routines.

VPRenderHTML: this routine takes an HTML string as a parameter and renders it on a VSPrinter control. The routine handles character and paragraph formatting, and tables. It ignores unknown HTML tags such as links and pictures.

There are three main reasons for providing these functions as source code rather than building them into the control:

  1. You can study the source code and learn useful techniques for programming the control. You can also customize the routines if they don't do exactly what you want.

  2. By keeping the utilities separate from the control, we avoid increasing the size and complexity of the control. Users who don't need the extra functionality can leave it out of their projects.

  3. The utilities can be extended and updated easily, without affecting the control and existing applications.

Note: VSPrinter 8 provides a new Styles property that makes VPSaveState and VPRestoreState obsolete, you should not need to use them in new projects. However, they are provided to facilitate upgrading existing projects. They are also useful as sample code and may be customized should you want to change the way they behave.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback