***************************************************************** * * * Function Definitions for VBPRINT.DLL * * * ***************************************************************** ----------------------------------------------------------------- InitializePrinter(ByVal hWnd%) As Integer Called at the beginning of a print job where hWnd equals the window handle of the calling applications topmost window. ----------------------------------------------------------------- PageLayoutSetup(ByVal nTop%, ByVal nRight%, ByVal nBottom%, ByVal nLeft%) As Integer Called to set the Margins for all subsequent pages. Called after InitializePrinter. ----------------------------------------------------------------- DonePrinting() As Integer Called at the end of the print job to do general clean up and release the printer. ----------------------------------------------------------------- StartParagraph( ByVal szFontName$, ByVal nFontSize%, ByVal nStyle%) As Integer Called before starting to send paragraph text, szFontName is the name of the font to be used, nFontSize is the size of the font in Points, and nStyle is print attributes to be used, they are defined as follows: #define BOLD_FONT 0x0001 #define ITALIC_FONT 0x0002 #define TOP_BORDER 0x0004 #define LEFT_BORDER 0x0008 #define RIGHT_BORDER 0x0010 #define BOTTOM_BORDER 0x0020 #define CHECK_BOX 0x0100 ----------------------------------------------------------------- PrintParagraphText(ByVal szText$) As Integer Used to send text into a paragraph, this may be called multiple times to add more and more text into the paragraph. szText is the text to be printed. ----------------------------------------------------------------- FinishParagraph() As Integer Called at the end of printing a paragraph to do general cleanup. ----------------------------------------------------------------- HeadlinePrint( ByVal szHeadLine$, ByVal szFontName$, ByVal nFontSize%, ByVal nStyle%) As Integer This is a one stop shopping approach to printing text, the text in szHeadLine is printed using the font szFontName, in size nFontSize defined in points, with the style of nStyle. See style definitions above. ----------------------------------------------------------------- SetParagraphSpacing(ByVal nSpacing%) As Integer Used to set the spacing between paragraphs, nSpacing is defined in points. The default is 18pts (1/4"). ----------------------------------------------------------------- EjectPage() As Integer Unconditionally ejects the page from the printer. All text already on the page is printed. The cursor position is placed on the upper left hand corner of the new page. ----------------------------------------------------------------- PrintDLLVersion() As Integer Returns the version of the VBPRINT.DLL, the major version number is in the low byte of the integer and the minor version number is in the high byte of the integer. ----------------------------------------------------------------- SetUpColumns( ByVal Columns%, ByVal nC1%, ByVal szFontName$, ByVal nFontSize%, ByVal nStyle%) As Integer This sets up how columns will be printed, Columns is the number of columns to be printed, nC1 is an array of column widths in one hundredths of an inch (100 = 1") units. Maximum number of columns is eight. szFontName is the name of the font the columns will print in, nFontSize is the size of the font in Points and nStyle is the style they will be printed in, see style definitions above. ----------------------------------------------------------------- PrintColumnText(ByVal szText$) As Integer Used to send text into the columns. The text for each cell will be delimited by a tab character [chr$(9)]. For example: "C1\tC2\tC3\tC4" would print C1 C2 C3 c4 ----------------------------------------------------------------- EndColumnPrinting() As Integer Used at the end of printing columns to do general cleanup. ----------------------------------------------------------------- PrintColumnHeaders( ByVal szHeader$, ByVal Columns%, ByVal nC1%, ByVal szFontName$, ByVal nFontSize%, ByVal nStyle%) As Integer This is the one stop shopping approach again, the text in szHeader is printed in columns, defined by the number of columns (Columns), with the widths in an array nC1 in hundreths of an inch (100 = 1"), with the font szFontName, with the size nFontSize in Points, and the style of nStyle, see above for definition of nStyle. ----------------------------------------------------------------- MoveYPos( ByVal nY%) As Integer Moves the current cursor position down in the vertical direction. The value is in hundredths of an inch. ----------------------------------------------------------------- DrawLine( ByVal nX1%, ByVal nY1%, ByVal nX2%, ByVal nY2%) As Integer Draws a line from position (nX1, nY1) to (nX2, nY2). The coordinate system is in TWIPS. ----------------------------------------------------------------- DrawRectangle( ByVal nX1%, ByVal nY1%, ByVal nX2%, ByVal nY2%) As Integer Draws a Rectangle with the upper left hand corner at (nX1, nY2) and the lower right hand corner at (nX2, nY2). The coordinate system is in TWIPS. ----------------------------------------------------------------- DrawRndRectangle( ByVal nX1%, ByVal nY1%, ByVal nX2%, ByVal nY2%, ByVal nX3%, ByVal nY3%) As Integer Draws a Rectangle with rounded corners, the upper left hand corner is at (nX1, nY1) and the lower left hand corner is at (nX2, nY2). The rounded corners have an elliptical shape determined by the height and width in (nX3, nY3). The coordinate system is in TWIPS. ----------------------------------------------------------------- DrawEllipse( ByVal nX1%, ByVal nY1%, ByVal nX2%, ByVal nY2%) As Integer Draws an ellipse that fits within the bounding rectangle defined by the upper left hand corner (nX1, nY1) and the lower right hand corner (nX2, nY2). The coordinate system is in TWIPS.