With draw functions you can draw text and graphic elements anywhere in the page. They are available for use in any expression, for example before print or after print. You can use the ; operator to perform more than one operation for each expression.
Draw text funtion
function TextOp(Top,Left,Width,Height:integer; Text,LFontName,WFontName:WideString;
FontSize,FontRotation,FontStyle,FontColor,Type1Font:integer;
CutText:boolean;Alignment:integer;WordWrap,RightToLeft:Boolean;
PrintStep,BackColor:integer;transparent:boolean):Boolean
Graphic operation function
function GraphicOp(Top,Left,Width,Height:integer;
DrawStyle:integer;BrushStyle:integer; BrushColor:integer;
PenStyle:integer;PenWidth:integer; PenColor:integer):Boolean
Image operation function
function ImageOp(Top,Left,Width,Height:integer;
ImageDrawStyle:integer;PixelsPerInchg:integer;
PreviewOnly:Boolean;Expression:String):Boolean
Barcode operation function
function OnBarcodeOp (Top,Left,Width,Height:integer;
Expression,DisplayFormat:WideString;BarType,Modul:Integer;Ratio,Rotation:Currency;
CalcChecksum:Boolean;BColor:Integer):Boolean;
Text height funtion, returns text height in twips
function TextHeight(Text,LFontName,WFontName:WideString;
RectWidth,FontSize,FontStyle,Type1Font:integer;
PrintStep,BackColor:integer;transparent:boolean):Boolean
SetPageSource, set page size, and paper source
function SetPageSource(QtIndex:integer;
Custom:Boolean;CustomWidth,CustomHeight,PaperSource:integer;
ForcePaperName:String;Duplex:integer):Boolean
QtIndex is the index of the paper as shown in page setup, papersource is the
integer value for paper source (0=default, force paper name are integer indexes
as shown in page setup, custom indexes for printers are shown in System information,
Help menu.
SetPageOrientation, set page orientation
function SetPageOrientation(orientation:integer):Boolean;
Orientation is: 0-Default, 1-Portrait, 2-Landscape
Parameters
Name | Meaning | ||||||||||||||||||||||||||||||||
Top, Left, Width, Height | Position and size of the element in twips (1440 twips=1 inch) | ||||||||||||||||||||||||||||||||
Text | Text to print, can be also a expression | ||||||||||||||||||||||||||||||||
LFontName, WFontName | Font names for Linux and Windows | ||||||||||||||||||||||||||||||||
FontSize | Font size | ||||||||||||||||||||||||||||||||
FontRotation | Rotation in 1/10 degrees unit | ||||||||||||||||||||||||||||||||
FontStyle | A integer 0 value=no style, to add styles sum this values:
So a font italic bold font will be 3 |
||||||||||||||||||||||||||||||||
FontColor, PenColor, BrushColor, BackColor | An integer value representing the color you can use hexadecimal notation with the syntax $BBGGRR That is white is $FFFFFF, red is $RR, blue is $BB0000 |
||||||||||||||||||||||||||||||||
FontSize | Size in standard point units (1 point=1/72 inch) | ||||||||||||||||||||||||||||||||
Type1Font | Font for Adobe PDF export, this is an integer with the following table:
|
||||||||||||||||||||||||||||||||
CutText | Cuts the text when does not fit the rectangle size | ||||||||||||||||||||||||||||||||
Alignment | Alignment information, 0 for default alignment or a combination (sum) of the folowing values, note you can only combine horizontal and vertical alignments:
|
||||||||||||||||||||||||||||||||
Wordwrap | Break sentences into lines if the text does not fit horizontally | ||||||||||||||||||||||||||||||||
RightToLeft | If True draw the text in right to left mode | ||||||||||||||||||||||||||||||||
Transparent | If true does the background of the text is transparent and BackColor is ignored | ||||||||||||||||||||||||||||||||
PrintStep | Selects the font for dot matrix print drivers and text output to dot matrix printers:
|
||||||||||||||||||||||||||||||||
DrawStyle | Draw type for graphic operation:
|
||||||||||||||||||||||||||||||||
PenWidth | Pen width in twips (0=minimum device width) | ||||||||||||||||||||||||||||||||
BrushStyle |
|
||||||||||||||||||||||||||||||||
PenStyle |
|
||||||||||||||||||||||||||||||||
ImageDrawStyle |
|
||||||||||||||||||||||||||||||||
PixelsPerInch | Same meaning as in TRpImage documentation | ||||||||||||||||||||||||||||||||
PreviewOnly | Same meaning as in TRpImage documentation | ||||||||||||||||||||||||||||||||
Expression (for image) |
This must be always a string, so if you want to print a image stored inside a field: 'YOURDATASET.YOURFIELD' If the field contains a path to a file: ''''+'YOURDATASET.YOURFIELD'+'''' If you place a filepath directly: '''c:\images\backgroung.bmp''' |
||||||||||||||||||||||||||||||||
Expression (for barcode) | This must be always a string, if you want to print a barcode stored inside a field, provide the field as a string: 'YOURDATASET.YOURFIELD' To provide the barcode directly write ''''+'12356789012'+'''''' |
||||||||||||||||||||||||||||||||
DisplayFormat (for barcode) | The resulting expression will be formatted with this string before calculating the barcode. | ||||||||||||||||||||||||||||||||
BarType | Barcode type as an integer
|
||||||||||||||||||||||||||||||||
Modul | Barcode module in twips, that is the smallest bar with unit in twips. | ||||||||||||||||||||||||||||||||
Ratio | The ratio is applied to some barcodes see documentation. | ||||||||||||||||||||||||||||||||
Rotation | Rotation for the barcode, currently supported are 0,90,180 and 270 | ||||||||||||||||||||||||||||||||
CalcCheckSum | The barcode will calculate checksum values for some barcodes | ||||||||||||||||||||||||||||||||
BColor | Barcode color for bars | ||||||||||||||||||||||||||||||||
RecWidth | Rectangle width for height calculation (in twips) |