ComponentOne VSView 8.0
VSPrinter Control

The VSPrinter control allows you to quickly and easily create documents for printing and previewing. It supports multiple columns, text wrapping, headers and footers, tables, and graphics. You can implement multiple page print previews with zooming, panning, and paging by setting a single property. The new VSPrinter control has a thumbnail preview mode that lets you see many pages at once.

The VSPrinter control is capable of exporting HTML and RTF documents that can be viewed and edited with your favorite word processor, or posted on the Web. It also features an optional built-in document navigation bar that allows users to zoom and page through preview documents.

The VSPrinter control allows you to save the documents you create to disk, and uses an efficient compression engine so the documents consume little disk space. The compression and archiving routines are exposed through the Archive method and ArchiveInfo property, which allow you to use compression for other purposes besides saving and loading VSPrinter documents. VSPrinter archives are not PKZIP-compatible, but they are compatible with archive files created with ComponentOne's VSFlexGrid Pro control.

Use the VSPrinter control to create sophisticated reports, either based on database tables or from arbitrary sources. You may also use it to produce form-type documents, newsletters, format and print data files, or to let your application create any type of custom output it needs.

Note: Before you can use a VSPrinter control in your application, you must add the VSPrint8.ocx file to your project. Please refer to the VB documentation for details on adding controls to your projects.

To distribute applications you create with the VSPrinter control, you must install and register it on the user's computer. The Setup Wizard provided with Visual Basic provides tools to help you do that. Please refer to the Visual Basic manual for details.

The VSPrinter control provides the following properties, events and methods:

All of the properties, events and methods for the VSPrinter control are listed in the following tables. Properties, events, and methods that apply only to this control, or that require special consideration when used with it, are marked with an asterisk (*). These are documented in later sections. For documentation on the remaining properties, see the Visual Basic documentation.

 

VSPrinter Properties

 

*AbortCaption

Returns or sets the caption for the default Abort dialog.

*AbortTextButton

Returns or sets the caption for the button in the default Abort dialog.

*AbortTextDevice

Returns or sets the caption for the Device string in the default Abort dialog.

*AbortTextPage

Returns or sets the caption for the Page string in the default Abort dialog.

*AbortWindow

Returns or sets whether an Abort dialog will appear while the control is printing.

*AbortWindowPos

Returns or sets the placement for the default Abort dialog.

*AccessibleDescription

Gets or sets the description of the control used by accessibility client applications.

*AccessibleName

Gets or sets the name of the control used by accessibility client applications.

*AccessibleRole

Gets or sets the role of the control used by accessibility client applications.

*AccessibleValue

Gets or sets the value of the control used by accessibility client applications.

*Action

Executes an action such as 'StartDoc' or 'EndDoc'.

Appearance

See the Visual Basic documentation.

*ArchiveInfo

Gets information from a ComponentOne archive file.

*AutoLinkNavigate

Gets or sets whether the control should automatically detect hyperlinks embedded in the preview document, fire the Value event, and change the cursor or perform the navigation automatically.

*AutoRTF

Returns or sets whether RTF text should be automatically detected.

BackColor

See the Visual Basic documentation.

BorderStyle

See the Visual Basic documentation.

*BrushColor

Returns or sets the color of the brush used to fill graphical objects.

*BrushStyle

Returns or sets the style of the brush used to fill graphical objects.

*CalcParagraph

Calculates the size of a paragraph, in twips, and returns results in TextWid, TextHei, X1, Y1, X2, and Y1.

*CalcPicture

Calculates the size of a picture, in twips, and returns results in X1, Y1, X2, and Y1.

*CalcTable

Calculates the size of a table, in twips, and returns results in TextWid, TextHei, X1, Y1, X2, and Y1.

*CalcText

Calculates the size of a string, in twips, and returns results in TextWid, TextHei, X1, Y1, X2, and Y1.

*CalcTextRTF

Calculates the size of an RTF string, in twips, and returns results in TextWid, TextHei, X1, Y1, X2, and Y1.

*Collate

Returns or sets whether multiple copies will be collated.

*ColorMode

Returns or sets the color mode on color printers.

*Columns

Returns or sets the number of columns on a page.

*ColumnSpacing

Returns or sets the spacing between columns, in twips.

*Copies

Returns or sets the number of copies to print.

*CurrentColumn

Returns the number of the column being printed.

*CurrentLine

Returns the number of the line being printed.

*CurrentPage

Returns the number of the page being printed.

*CurrentX

Returns or sets the horizontal position of the cursor, in twips from the left of the page.

*CurrentY

Returns or sets the vertical position of the cursor, in twips from the top of the page.

*DefaultDevice

Returns or sets whether device changes affect the Windows default settings.

*Device

Returns or sets the name of the current printer.

*Devices

Returns the names of the printing devices available (zero-based vector).

*DocName

Returns or sets the name of the current document (alias for FileName).

*DPI

Returns the resolution of the printing device, in dots per inch.

*Draw

Draws an object within the rectangle defined by the X1, Y1, X2, and Y2 properties.

*Driver

Returns the name of the current printer driver.

*Duplex

Returns or sets duplex or double-sided printing.

*EmptyColor

Returns or sets the color of the area around the preview page.

Enabled

Returns/sets a value that determines whether an object can respond to user-generated events.

*Error

Returns a code that describes an error condition.

*ErrorDescription

Returns a message that describes an error condition (see also the Error property).

*ExportFile

Returns or sets the name of an export file of type defined by the VSPrinter property.

*ExportFormat

Returns or sets the format of the output file (HTML or RTF).

*ExportNavBar

Returns or sets the HTML template to be used for the navigation bar in paged HTML export files.

*ExportRaw

Injects raw text into the output file specified by the VSPrinter property.

*FileName

Returns or sets the name of the current document.

*FindTag

Finds a tag in the current document, returns the page and bounding rectangle (in X1,Y1,X2,Y2) for the match.

*FindText

Finds text in the current document, returns the page and bounding rectangle (in Y1,X2,Y2,VSPrinter) for the match.

Font

Returns a Font object.

*Footer

Returns or sets the footer text.

*hDC

Returns the control's current hDC.

*HdrColor

Returns or sets the color used to print headers and footers.

*HdrFont

Returns or sets the font used to draw headers and footers.

*Header

Returns or sets the header text.

hWnd

Returns a handle (from Microsoft Windows) to an object's window.

*IndentFirst

Returns or sets an additional left indent for the first line of each paragraphs, in twips.

*IndentLeft

Returns or sets an additional left indent for the first line of each paragraphs, in twips.

*IndentRight

Returns or sets the right indent for paragraphs, in twips.

*IndentTab

Returns or sets the left indent for the first line of a paragraph, in twips.

*LargeChangeHorz

Returns or sets the amount of change to the VSPrinter property when the user clicks the scroll bar area.

*LargeChangeVert

Returns or sets the amount of change to the VSPrinter property when the user clicks the scroll bar area.

*LineSpacing

Returns or sets the line spacing, as a percentage (for example, 100 is single spacing, 200 is double spacing).

*LoadPicture

Returns a picture loaded from a file or URL.

*MarginBottom

Returns or sets the bottom margin, in twips.

*MarginFooter

Returns or sets the footer margin, in twips.

*MarginHeader

Returns or sets the header margin, in twips.

*MarginLeft

Returns or sets the left margin, in twips.

*MarginRight

Returns or sets the right margin, in twips.

*MarginTop

Returns or sets the top margin, in twips.

*Measure

Returns width and height of a string, in twips, in TextHei and VSPrinter properties/

*Measuring

Returns True if the control is measuring text, False if it is rendering

MouseIcon

Sets a custom mouse icon.

MousePointer

Returns/sets the type of mouse pointer displayed when over part of an object.

*NavBar

Returns True if the control is measuring text, False if it is rendering

*NavBarColor

Returns or sets the color of the document navigation bar.

*NavBarMenuText

Returns or sets the text that appears on the NavBar Zoom menu

*NavBarText

Returns or sets the text displayed on the document navigation bar.

*Navigation

Returns or sets the type of document navigation interface provided (mouse, mouse wheel, or keyboard).

*NDevices

Returns the number of printing devices available.

*NPorts

Returns the number of ports to which the current printer is connected.

*Orientation

Returns or sets the paper orientation.

*OutputFileName

Returns or sets the name of a printer output file (if empty, output is sent to the printer).

*PageBorder

Returns or sets the type of border to draw around each page.

*PageCount

Returns the number of pages in the current document.

*PageHeight

Returns the page height, in twips.

*PageWidth

Returns the page width, in twips.

*PalettePicture

Returns or sets a picture with a palette that is used to render the document.

*PaperBin

Returns or sets the paper bin to use.

*PaperBins

Returns whether a given paper bin is available on the current printer.

*PaperHeight

Returns or sets the height of a custom paper size, in twips.

*PaperSize

Returns or sets a standard paper size.

*PaperSizes

Returns whether a given page size is available on the current printer.

*PaperWidth

Returns or sets the width of a custom paper size, in twips.

*Paragraph

Renders a paragraph on the page at the current cursor position.

*PenColor

Returns or sets the color of the pen used to outline graphical objects.

*PenStyle

Returns or sets the style of the pen used to outline graphical objects

*PenWidth

Returns or sets the width of the pen used to outline graphical objects.

*PhysicalPage

Returns or sets whether to use the physical size of the page or on its printable area.

Picture

Returns a picture of the current preview page or sets a picture to be displayed on the page.

*Polygon

Draws a polygon defined by a string of X,Y coordinates.

*Polyline

Draws a line defined by a string of X,Y coordinates.

*Port

Returns or sets the name of the current port.

*Ports

Returns the names of the ports to which the current printer is connected.

*Preview

Returns or sets whether output saved for previewing or sent directly to the printer.

*PreviewPage

Returns or sets the current preview page (first page is 1).

*PreviewPages

Returns the number of pages displayed in the preview area.

*PrintQuality

Returns or sets the print quality.

*ProportionalBars

Returns or sets whether the scrollbar thumbs (VSPrinter Control) should be proportional to the size of the visible area.

*ReadyState

Returns the current state of the control.

*RenderControl

Renders an OPP-enabled control (such as the VSFlexGrid) on the page.

*RetrieveTag

Returns a string containing the first tag found on a region of the current document.

*RetrieveText

Returns a string containing the text on a region of the current document.

*ScaleOutput

Returns or sets the percentage by which the printed output is to be scaled.

*ScrollLeft

Returns or sets the left coordinate of the visible area, in twips.

*ScrollTop

Returns or sets the top coordinate of the visible area, in twips.

*ShowGuides

Returns or sets whether margin guides are displayed on the page.

*SmallChangeHorz

Returns or sets the amount of change to the VSPrinter property when the user clicks the scroll arrow.

*SmallChangeVert

Returns or sets the amount of change to the VSPrinter property when the user clicks the scroll arrow.

*SpaceAfter

Returns or sets the vertical distance after each paragraph, in twips.

*SpaceBefore

Returns or sets the vertical distance before each paragraph, in twips.

*Styles

Returns a collection of styles that can be applied to the document.

*Table

Renders a table on the page.

*TableBorder

Returns or sets the type of border for tables.

*TableCell

Returns or sets properties of a table cell or range.

*TablePen

Returns or sets the width of the borders between table cells.

*TablePenLR

Returns or sets the width of the left and right table borders.

*TablePenTB

Returns or sets the width of the top and bottom table borders.

*TableSep

Returns or sets the characters used by tables as row and column separators.

*Text

Renders a string on the page at the current cursor position.

*TextAlign

Returns or sets the alignment of printed paragraphs, textboxes, and tables.

*TextAngle

Returns or sets the text angle, in tenths of degree.

*TextColor

Returns or sets the color used to print text.

*TextHei

Returns the height of a string measured with the Measure property, in twips.

*TextHeight

Returns the height of a string, in twips.

*TextRTF

Renders RTF text on the page at the current cursor position.

*TextWid

Returns the width of a string measured with the VSPrinter property, in twips.

*TextWidth

Returns the width of a string, in twips.

*Track

Returns or sets whether scrolling occurs as the user drags the scroll thumb.

*TrueType

Returns or sets how TrueType fonts should be printed.

*TwipsPerPixelX

Returns the number of twips per printer pixel in the horizontal direction.

*TwipsPerPixelY

Returns the number of twips per printer pixel in the vertical direction.

*URL

Returns or sets the name of a URL (Universal Resource Locator) to load into the control.

*Version

Returns the version of the control currently loaded.

*X1

Returns or sets the left coordinate of the rectangle used with the VSPrinter property.

*X2

Returns or sets the right coordinate of the rectangle used with the VSPrinter property.

*Y1

Returns or sets the top coordinate of the rectangle used with the VSPrinter property.

*Y2

Returns or sets the bottom coordinate of the rectangle used with the VSPrinter property.

*Zoom

Returns or sets the preview scale: set to a percentage, or zero to fill the control.

*ZoomMax

Returns or sets the maximum valid zoom factor.

*ZoomMin

Returns or sets the minimum valid zoom factor.

*ZoomMode

Sets or returns the zoom mode (explicit percentage or one of the automatic settings).

*ZoomStep

Returns or sets the step for zooming with the mouse.

 

VSPrinter Methods

 

*AddLink

Adds a hyperlink to the document.

*AddLinkTarget

Adds a Target tag (%PDFName|<name>) to the document at the cursor position.

*AddTable

Renders a table with row headers and special formatting.

*AddTableArray

Renders a variant array as a table with row headers and special formatting.

*Archive

Adds, extracts, or deletes files from a ComponentOne archive file.

*Clear

Clears the control, destroying any currently loaded document.

*ClientToPage

Converts mouse coordinates to page coordinates.

*DrawCircle

Draws a circle, circular wedge, or circular arc.

*DrawEllipse

Draws an ellipse, wedge, or arc.

*DrawLine

Draws a line segment.

*DrawPicture

Draws a picture.

*DrawRectangle

Draws a rectangle.

*EndDoc

Fired after a document is successfully printed.

*EndOverlay

Closes a page that was opened with the StartOverlay method.

*EndTable

Renders table defined since call to StartTable.

*EndTag

Ends the definition of a document tag started with StartTag.

*GetMargins

Returns the printable area, excluding margins, in the X1, Y1, X2, and Y2 properties.

*KillDoc

Cancels and deletes the current document.

*LoadDoc

Loads a document from disk.

*MovePages

Moves a group of pages to the start or to the end of the document

*NewColumn

Skips to the next column.

*NewPage

Skips to the next page.

*PageToClient

Converts page coordinates to mouse coordinates

*PrintDialog

Displays a printer selection or page setup dialog.

*PrintDoc

Prints the current document (being previewed) on the printer.

*PrintFile

Prints the current document (being previewed) on the printer.

*Refresh

See the Visual Basic documentation.

*SaveDoc

Saves the current document to disk.

*ScrollIntoView

Scrolls the control so the specified rectangle or point is visible.

*StartDoc

Starts a new document.

*StartOverlay

Reopens an existing preview page for additional output.

*StartTable

Defers table rendering until call to EndTable.

*StartTag

Starts the definition of a document tag (for later use with the FindTag and RetrieveTag methods).

*TextBox

Draws text within a rectangle.

 

VSPrinter Events

 

*AfterFooter

Fired after printing the footer for each page to allow font changes.

*AfterHeader

Fired after printing the header for each page to allow font changes.

*AfterTableCell

Fired after a table cell is rendered, to allow custom painting.

*AfterUserPage

Fired after switching preview pages in response to a user request.

*AfterUserScroll

Fired after scrolling in response to a user request.

*AfterUserZoom

Fired after Zooming in or out in response to a user request.

*BeforeFooter

Fired before printing the footer for each page to allow font changes.

*BeforeHeader

Fired before printing the header for each page to allow font changes.

*BeforeTableCell

Fired before a table cell is rendered, to allow custom formatting.

*BeforeUserPage

Fired before switching preview pages in response to a user request.

*BeforeUserScroll

Fired before scrolling in response to a user request.

*BeforeUserZoom

Fired before Zooming in or out in response to a user request.

Click

See the Visual Basic documentation.

DblClick

See the Visual Basic documentation.

*EndDoc

Fired after a document is successfully printed.

*EndPage

Fired after each page is complete.

*Error

Fired when an error is detected (a code is returned in the Error property).

KeyDown

See the Visual Basic documentation.

KeyPress

See the Visual Basic documentation.

KeyUp

See the Visual Basic documentation.

*LayoutThumbnails

Fired when the thumbnail preview is about to change to allow customization of the preview layout.

*LoadingDoc

Fired while loading documents from disk, once after each page is loaded.

MouseDown

See the Visual Basic documentation.

*MouseLink

Fired when the user clicks or moves the mouse over a hyperlink (see AutoLinkNavigate property).

MouseMove

See the Visual Basic documentation.

MouseUp

See the Visual Basic documentation.

*NewColumn

Fired after each column and page break.

*NewLine

Fired after each line break.

*NewPage

Fired after each page is created.

*ReadyStateChange

Fired after the state of the control changes.

*ResetDC

Fired after a page is ejected and before the next page is started.

*SavingDoc

Fired while saving documents to disk, once after each page is saved.

*StartDoc

Fired after a new document is created.

 

 


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

Product Support Forum  |  Documentation Feedback