PageScript 32 - User guide for [x]Harbour and Xbase++ - Version 3.0.3

Print Preview Window

The Print Preview Window

Function reference

PSAbort()

PSAsciiToAnsi()

PSBarCode()

PSBeginDoc()

PSBeginDocEx()

PSBeginEmuDoc()

PSBeginRawDoc()

PSBitmap()

PSEllipse()

PSEllipseEx()

PSEndDoc()

PSEndEmuDoc()

PSEndRawDoc()

PSFrame()

PSFrameEx()

PSGetAsciiToAnsi()

PSGetBin()

PSGetBorderColor()

PSGetBorderThickness()

PSGetCaps()

PSGetCoorSystem()

PSGetCopies()

PSGetCPI()

PSGetDecimalSep()

PSGetDefPrinter()

PSGetDefaultPrinter()

PSGetDuplex()

PSGetFillColor()

PSGetFillPattern()

PSGetFonts()

PSGetFontAngle()

PSGetFontBColor()

PSGetFontCount()

PSGetFontFColor()

PSGetFontJustify()

PSGetFontName()

PSGetFontNames()

PSGetFontSize()

PSGetFontStyle()

PSGetJustify()

PSGetLPI()

PSGetMaxHeight()

PSGetMaxWidth()

PSGetOrientation()

PSGetPageSize()

PSGetPaperBin()

PSGetPaperBins()

PSGetPaperBinCount()

PSGetPaperBinNames()

PSGetPaperBinNumbers()

PSGetPaperCount()

PSGetPaperNames()

PSGetPaperNumbers()

PSGetPrinter()

PSGetPrinters()

PSGetPrinterCaps()

PSGetPrinterCapsEx()

PSGetPrinterCount()

PSGetPrinterHandle()

PSGetPrinterNames()

PSGetTextHeight()

PSGetTextWidth()

PSGetTitle()

PSGetUnit()

PSGetUseDIB()

PSGetVersion()

PSGetXerox()

PSInit()

PSIsPreviewVisible()

PSLine()

PSLineEx()

PSNewPage()

PSPrintDialog()

PSPrintFile()/PSPrintEmuFile()

PSPrintRawFile()

PSSetAsciiToAnsi()

PSSetBin()

PSSetBorder()

PSSetBorderColor()

PSSetBorderThickness()

PSSetClipperComp()

PSSetCoorSystem()

PSSetCopies()

PSSetCPI()

PSSetDecimalSep()

PSSetDevice()

PSSetDirectPrint()

PSSetDuplex()

PSSetFileName()

PSSetFill()

PSSetFillColor()

PSSetFillPattern()

PSSetFont()

PSSetFontAttributes()

PSSetFontAngle()

PSSetFontBColor()

PSSetFontFColor()

PSSetFontName()

PSSetFontSize()

PSSetFontStyle()

PSSetJustify()

PSSetLPI()

PSSetOrientation()

PSSetPageSize()

PSSetPaperBin()

PSSetPDFOwnerPassword()

PSSetPrinter()

PSSetPWBounds()

PSSetPWColors()

PSSetPWPosition()

PSSetPWSize()

PSSetPWState()

PSSetPWZoomLevel()

PSSetRowCol()

PSSetTitle()

PSSetUnit()

PSSetUseDIB()

PSSetXerox()

PSTextBox()

PSTextBoxEx()

PSTextOut()

PSTextOutEx()

PSVersion()

PSWaterMark()

RGB()

Obsolete or unsupported

These functions are either unsupported or became obsolete in this version of PageScript 32 for xbase like programming languages.

PSPrnChanged()

PSRefreshPrinters()

PSSendMail()

PSSetPrintPreview()

PSSetTimeSlice()

PSShowIcon()

PSShutDown()

Hello world

Like almost any programming book, we must start by printing the famous "Hello world" using PageScript 32. Every example assumes that PSInit() returns zero (no error).

Example 1 - Delphi, using the TPageScript class

1 if oPS.Init() = 0 then begin
2    oPS.BeginDoc('Hello world');
3    oPS.SetUnit(APS_TEXT);
4    oPS.SetLPI(6);
5    oPS.SetCPI(10);
6    oPS.TextOut(5, 5, 'Hello world');
7    oPS.EndDoc();
8 end;

Lets explain the code, line by line.

Line 1 initializes PageScript 32. If everything is OK, it returns 0.

Line 2 starts a new print job, on the default printer with the title set to "Hello world"

Line 3 sets the unit of mesurement to text coordinates that barely mimics old DOS printer's rows and columns coordinate system.

Line 4 sets the number of LPI (lines per inch) to 6. The default value is 6, so this line is not required. We added it for demonstration purposes only.

Line 5 sets the number of CPI (characters per inch) to 10. The default value is 10, so this line is not required. We added it for demonstration purposes only.

Line 6 send the command to print "Hello world" at column 5 and row 5. It uses the default/current set font, font size, font foreground and background colors.

Line 7 ends the print job.

Line 8 is the end of the if structure.

Example 2 - XBase++ / [x]Harbour, using functions, procedures and commands wrappers

1 #Include "PScript.ch"
2 if PSInit() == 0
3    BEGINDOC USING 0 TITLE "Hello world"
4       PSSetUnit(APS_TEXT)
5       PSSetLPI(6)
6       PSSetCPI(10)
7       @5,5 TEXTOUT "Hello world"
8    ENDDOC
9 endif

Lets explain the code, line by line.

Line 1 is the standard Include statement. PSCRIPT.CH contains all deinitions you need to work with PageScript 32.

Line 2 initializes PageScript 32. If everything is OK, it returns 0.

Line 3 starts a new print job, on the default printer with the title set to "Hello world"

Line 4 sets the unit of mesurement to text coordinates that barely mimics old DOS printer's rows and columns coordinate system.

Line 5 sets the number of LPI (lines per inch) to 6. The default value is 6, so this line is not required. We added it for demonstration purposes only.

Line 6 sets the number of CPI (characters per inch) to 10. The default value is 10, so this line is not required. We added it for demonstration purposes only.

Line 7 send the command to print "Hello world" at column 5 and row 5. It uses the default/current set font, font size, font foreground and background colors.

Line 8 ends the print job.

Line 9 is the end of the if structure.

PageScript 32 is shipped with a demo program (PSTESTXXX.EXE) for each programming languages that we included (althgough every 32 bits programming languages are supported) that demonstrates most of the aspects and techniques to produce all kind of documents. We invite you to open and study these sample programs.