Demo |
This is a sample program that creates the “Demo.PDF” that is included in this package, by analyzing it, you will be able to see how simple its is, and at the same time how powerful this new class is.
#include "dll.ch"
#include "gra.ch"
#include "xbp.ch"
#include "common.ch"
#include "xbpdev.ch"
#pragma library("XppPDF61.lib")
PROCEDURE MAIN
fl := 'Demo.Pdf'
use parts
pdf := xbppdf():New()
dc := pdf:Create( fl )
pg := pdf:newpage(XBPPRN_FORM_LETTER)
pdf:Box( 1, 1, 60, 78 )
pdf:Image( 2, 2, 5, 77, "Logo.JPG" )
pdf:LineWidth( 2 )
pdf:Box( 6, 2, 10, 77, 10)
pdf:TextColor( GRA_CLR_BLUE )
pdf:font( '14.Courier New Bold' )
pdf:Text( 7, 10, "Parts Price List")
pdf:Text( 7, 60, dtoc(date()) )
pdf:LineWidth( 1 )
pdf:Box( 12, 2, 50, 77 )
pdf:Line( 12, 13, 50, 13 )
pdf:Line( 12, 54, 50, 54 )
pdf:Line( 12, 65, 50, 65 )
pdf:TextColor( GRA_CLR_BLACK )
pdf:font( '10.Courier New' )
pdf:text( 12.4, 3, "Prt Nmbr" )
pdf:text( 12.4, 14, "Description" )
pdf:text( 12.4, 55, " Available" )
pdf:text( 12.4, 66, " Price" )
pdf:Line( 14, 2, 14, 77 )
go top
line := 14
do while .not. eof()
pdf:Text( line, 3, number )
pdf:Text( line, 14, descrip )
pdf:Text( line, 57, transform( qt, '###,###') )
pdf:Text( line, 66, transform( price, '###,###.##') )
line = line + 1
skip
enddo
pdf:BoxColor( GRA_CLR_RED )
pdf:Box( 52, 6, 57, 73, 25 )
pdf:TextColor( GRA_CLR_DARKBLUE )
pdf:font( '20.Courier New' )
pdf:Text( 52.5, 9, 'Demo Created by Softsupply Informatica' )
pdf:TextColor( GRA_CLR_BLACK )
pdf:font( '8.Courier New Italic' )
pdf:Text( 54, 9, 'Contact :' )
pdf:Text( 54, 44, 'eMail :' )
pdf:Text( 55, 9, 'Phone :' )
pdf:Text( 55, 44, 'Fax :' )
pdf:font( '12.Courier New' )
pdf:Text( 54, 15, 'Edgar Borger' )
pdf:Text( 55, 15, '(5511) 3159-1997' )
pdf:Text( 55, 49, '(5511) 3255-5224' )
pdf:TextColor( GRA_CLR_BLUE )
pdf:Text( 54, 49, 'eborger@terra.com.br' )
pdf:enddoc(.t.)
close data
RETURN