|

the software that grows
with you
| |
|
Vouch32 Print Engine
|
| Vouch32 Print Engine provides a powerful
way to generate documents, reports, lists, labels, or whatever you can
imagine. The functions are modeled around PageScript because of the fact
that the developers who already have written code for their Clipper
application be able to port the code to xHarbour and/or xBase++ without
any significant change, thus enabling them to reuse their painful
investment.
I am also providing a V32Print.prg which contain wrapper functions to
divert output to Vouch32 or PageScript easily with setting a single flag
via SetV32Prn( lVouch ) function. If the flag is set to TRUE, then the
Vouch32.lib functions are used, otherwise, PageScript's functions are
used.
VPE ( Vouch32 Print Engine ) provides the following functions:
|
|
Vouch32 Print Functions
|
| V32PBeginDoc( nPrinter, cTitle, nOrient,
nCopies, lPreview, cFont, nPoint, nWidth, nZoom, nPrintQuality,
nPageSize|nPaperLength, nPaperWidth, nDuplex, lMono, nPaperSource,
nPrintDlg ) |
| V32PEndDoc() |
| V32PBitmap( nRow, nCol, nRow2, nCol2,
cBmpFile, nTransColor ) |
| V32PPicture( nRow, nCol, nRow2, nCol2, cPictureFile ) |
| V32PMetaFile( nRow, nCol, nRow2, nCol2, cMetaFile ) |
| V32PBarCode( nRow, nCol, cCode, nHeight,
nThick, lPrintCode, nType ) |
| V32PTextOut( nRow, nCol, xValue, cPicture,
nJustify, cFont, nStyle, nPoint, nFColor, nBColor, nAngle, nCharSet ) |
| V32PTextBox( nRow, nCol, nRow2, nCol2,
cText, nJustify, cFont, nStyle, nPoint, nFColor, nBColor, nThick ) |
| V32PLine( nRow, nCol, nRow2, nCol2,
nThick, nColor, nStyle ) |
| V32PEllipse( nRow, nCol, nRow2, nCol2,
nThick, nBColor, nFColor, nPattern ) |
| V32PFrame( nRow, nCol, nRow2, nCol2,
nThick, nBColor, nFColor, nPattern, nRoundR, nRoundC ) |
| V32PNewPage( nOrient ) |
| V32PSetUnit( nUnit ) |
| V32PVersion() |
| V32PSetPageSize( nLength, nWidth ) |
| V32PSetRowCol( nRows, nCols ) |
| V32PSetFont( cFont, nStyle, nPoint,
nFColor, nBColor, nCharSet ) |
| V32PSetFill( nColor, nPattern ) |
| V32PSetBorder( nThick, nColor ) |
| V32PSetJustify( nJustify ) |
| V32PSetDuplex( nDuplex ) |
| V32PSetPrnQuality( nPrnQuality ) |
| V32PSetMonoPrint( lMono ) |
| V32PSetBin( nPaperSource ) |
| V32PGetPrinters() |
| V32PGetDefPrinter( lByName ) |
| V32PGetCaps( ncPrinter, nOrientation ) |
| V32PGetFonts( ncPrinter ) |
| V32PGetTextWidth( cnPrinter,
nOrientation, aFont ) |
| V32PGraph( nRow, nCol, n2Row,
n2Col, aData, aLabels, aLegends, aColors, nType, cTitleTop, cTitleLeft,
cTitleBottom, cBkGdBitmap, l3D, lSpace, lStacked, lGridX, lGridY, lLegends,
lLabelsX, lLabelsY, lOutLines, lData, nPxlLeft, nPxlTop, nPxlWidth,
nPxlHeight, nBGColor ) |
| |
|
Vouch32 Print Dialog
|
|
|
Preview Window
|
|
| |
|
Info Icon Presentation
|
|
|
Preview Window Features
|
| Preview window has some peculiar
features. Unlike other preview windows, it offers zooming in and out
facility with left and right clicks. The window expands or shrinks
proportionately. If the page under preview has the landscape orientation,
window changes its dimensions accordingly. No % zooming. Expand or shrink
it as per your perspective.
Another useful feature is to print the pages of concern only. The image
below illustrates it well. If selective pages are to be printed, check the
'Selective Pages' radio button and then enter the page numbers in
the 'Mark Pages' field separated by comma ','.
|
 |
| You can also select a specific page by
clicking the 5th button on the toolbar. Enter the page number to be viewed
in the dialog box and the page will become current. |
|
|
| You can force VPE to display Printer
Selection Dialog through V32PBeginDoc()[ nPrinter ] parameter. On this
account, it differs from PageScript. You can either force VPE to open the
printer selection dialog or to use default printer. <nPrinter> thus
has two possible values, 0 or 99. VPE does not maintain database of
existing printers. All is done on the fly. |
|
The Code
|
function VouPrintPrv()
#define CLR_DARKGREEN V32Rgb( 0, 128, 0 )
#define CLR_GRAY v32Rgb( 198, 198, 198 )
#define CLR_YELLOW V32Rgb( 255, 255, 0 )
#define CLR_RED V32Rgb( 255, 0, 0 )
#define CLR_BLUE V32Rgb( 0, 0, 255 )
#define CLR_LIGHTGRAY V32Rgb( 225, 225, 225 )
#define CLR_LIGHTCYAN V32Rgb( 0, 255, 255 )
#define TA_LEFT 0
#define TA_RIGHT 1
#define TA_CENTER 2
#define FT_TIMES 'Times New Roman'
#define FT_ARIEL 'Ariel'
#define FT_SYSTEM 'System'
local cComp, cAdd1, cAdd2, cCity, cPhon, cEmail, cMoto
local cCust, cCAdd1, cCAdd2, cCCity, nI, nN, bmp_, nRow
local des_, amt_, dat_
local cPath := curDrive() + ':\' + CurDir() + '\'
local cLogo := cPath + 'abs1.bmp'
cComp := 'Creative Analysis & Concepts'
cAdd1 := '60, New Professor Colony, Adj Sunil Park, Ferozepur Road'
cAdd1 := cAdd1 + ', Ludhiana 141004 India'
cPhon := '91-161-2550034 2550427, 98140-30917'
cEmail := 'www.vouchcac.com vouch32@vouchcac.com'
cMoto := 'analysing concepts to perfection'
cCust := 'Vardhman Knit'
cCadd1 := '1527/6, Sunder Nagar Enclave GM'
cCAdd2 := 'Jalandhar ByPass Phase IV'
cCCity := 'Ludhiana 141001 India'
bmp_:={}
aadd( bmp_, cPath + 'vouch1.bmp' )
aadd( bmp_, cPath + '2000.gif' )
aadd( bmp_, cPath + 'science.ico' )
des_:={}
aadd( des_, 'Vouch32 Library Version 3.0' )
aadd( des_, 'One Year Support' )
aadd( des_, 'Three Years Free Upgradation' )
amt_:={ 15000.00, 5000.00, 5000.00 }
V32PBeginDoc( 99, 'Vouch32-Invoice', 1, 1, .t. )
V32PSetRowCol( 70,80 )
V32PPicture( 2, 70, 5, 80, cLogo )
V32PTextOut( 5, 80, cComp, , 1, 'Ariel', 0, 24, CLR_DARKGREEN )
V32PTextOut( 8, 80, cMoto, , 1, 'Times New Roman', 2, 10 )
V32PLine( 9.5, 35, 9.5, 80 )
V32PTextOut( 10, 80, cAdd1 , , TA_RIGHT, FT_ARIEL )
V32PTextOut( 11.5, 80, cPhon , , TA_RIGHT, FT_ARIEL )
V32PTextOut( 13, 80, cEMail, , TA_RIGHT, FT_ARIEL,,,, CLR_LIGHTGRAY )
V32PTextOut( 11, 1, 'Invoice', , 0, 'Ariel', 1, 48, CLR_RED )
v32PFrame( 15.3, 1, 21, 39, , , CLR_YELLOW )
V32PLine( 15.5, 1, 15.5, 39 )
v32PFrame( 15.3, 41, 21, 80 )
v32PLine( 18, 41, 18, 80 )
V32PTextOut( 16, 3, cCust )
V32PTextOut( 17, 3, cCAdd1 )
V32PTextOut( 18, 3, cCAdd2 )
V32PTextOut( 19, 3, cCCity )
V32PTextOut( 16, 42, 'Order:' )
V32PTextOut( 16, 59, 'PO-9087T', ,TA_RIGHT )
V32PTextOut( 19, 42, 'Date:' )
V32PTextOut( 19, 59, date()-5, , TA_RIGHT )
V32PTextOut( 16, 61, 'Invoice:' )
V32PTextOut( 16, 79, 'IN000077', , TA_RIGHT )
V32PTextOut( 19, 61, 'Date:' )
V32PTextOut( 19, 79, date(), , TA_RIGHT )
V32PTextOut( 22, 1, pad( ' Description of Items',58 ),,,,,,,CLR_GRAY )
V32PTextOut( 22,61, padl( 'Amount ',19 ),,,,,,,CLR_GRAY )
V32PFrame( 24, 1, 56, 80, , , , , 2, 4 )
V32PLine( 15.3, 60, 56, 60, 10 )
nRow := 25
nN := 0
for nI := 1 to 3
V32PBitmap( nRow, 3, nRow + 3, 15, bmp_[ nN + 1 ] )
V32PTextOut( nRow, 17, des_[ nN + 1 ] )
V32PTextOut( nRow, 79, amt_[ nN + 1 ], , TA_RIGHT )
nRow := 25 + ( ( nN + 1 ) * 4 )
nN := nN + 1
next
V32PTextOut( 56.5, 1, 'US$ Twenty Five Thousands Only' )
V32PTextOut( 56.5, 79, 25000.00, , TA_RIGHT )
V32PFrame( 58.5, 1, 67, 80 )
V32PLine ( 58.5, 50, 67, 50 )
v32PTextOut( 67, 40, ' This document is generated through Vouch32.lib ', ,
TA_CENTER, , , , CLR_YELLOW, CLR_BLUE )
V32PTextOut( 59, 3, '1. Library can be evaluated for three months.',,,FT_TIMES )
V32PTextOut( 61, 3, '2. Amount is payable by international draft.',,,FT_TIMES )
V32PTextOut( 63, 3, '3. Quarterly upgradations for three years assured.',,,FT_TIMES )
V32PTextOut( 65, 3, '* Errors & Ommissions Entertained!' )
V32PTextOut( 59, 79, 'for', , TA_RIGHT, , 2 )
V32PTextOut( 60, 79, cComp, , TA_RIGHT, FT_ARIEL, , 16, CLR_DARKGREEN )
V32PTextOut( 65, 79, 'Authorised Signatory', , TA_RIGHT )
V32PTextOut( 55, 3, 'Vouch32', , , FT_ARIEL, , 48, CLR_DARKGREEN, , 90 )
V32PTextOut( 53,10, 'An Extended Utilities Library', , , FT_ARIEL, , 24, CLR_BLUE, , 0 )
//V32PEllipse( 43,15,51,31,,,CLR_LIGHTCYAN )
V32PBarCode( 69,5 , 'Vouch32', 24, , , V32P_3OF9 )
V32PBarCode( 69,35, '12345' , 24, , , V32P_I2OF5 )
dat_:={}
aadd( dat_, { 120, 30, 160 } )
aadd( dat_, { 100, 130, 60 } )
aadd( dat_, { 120, 230, 210 } )
V32PGraph( 36,15,53,56, dat_, {'Apr','May','Jun' }, { 'Banana','Orange','Mango'
}, /* aColors */, 4, 'Monthly Sales', 'Northern Region', 'X-Deptt' )
V32PEndDoc()
return nil |
|