TEasyPrint works internal with a resolution of 1000 x 1000 Pixel, indepedent
from the physical resolution of the printer. Therefore the center of the
page is described by the values 500, 500.
There are two header lines available (Header1 and Header2), these header lines will be printed on every new page. Every header line has its own font (Header1Font and Header2Font). If more header lines are needed, this can be achieved by the event "AfterPrintHeader". The header lines are normally normalerweise left aligned, right alignment can be switched on by the characters "||" (2 x ASCII 179) in the textstring. All characters in front of "||" are left aligned and all following characters are right aligned printed.
There are so-called "makros" in any textstring allowed. "Makros" are
defined by the term $(Makroname). Actually there is only one Makro $(Page)
implemented, it replaces itself in the textstring with the actual
page count.
This method aborts the printing process.
C++ Builder:
bool __fastcall PrintBitmap (AnsiString
BitmapFilename, AnsiString Headline,float x,float y);
bool __fastcall PrintBitmap (AnsiString BitmapFilename, AnsiString
HeadLine);
bool __fastcall PrintBitmap (AnsiString BitmapFilename);
Delphi:
function PrintBitmap (BitmapFilename : AnsiString; Headline : AnsiString
; x : Single; y : Single) : boolean;
function PrintBitmap (BitmapFilename : AnsiString; HeadLine : AnsiString)
: boolean;
function PrintBitmap (BitmapFilename : AnsiString) : boolean;
function PrintBitmap (btm : Graphics.TBitmap; Headline : AnsiString;
x : Single; y : Single) : boolean;
function PrintBitmap (btm : Graphics.TBitmap; HeadLine : AnsiString)
: boolean;
function PrintBitmap (btm : Graphics.TBitmap) : boolean;
This method prints the bitmap from the file "BitmapFilename" (or the
bitmap - object "btm"), provids the headline "HeadLine" with the
scaling factors "x" and "y" at the postion where the internal y - cursor
actually is. The scaling factor "1" means original size. Scaling factor
0,5 means half - size and "2" double size.
If you do not use scaling factor, the scaling factor "1" is used.
C++ Builder:
bool __fastcall PrintText (int x,AnsiString
Text);
bool __fastcall PrintText (AnsiString text); //
not indented
Delphi:
function PrintText (x : integer; Text : AnsiString) : boolean;
function PrintText (text : AnsiString) : boolean;
This Method prints the contents of the variable "text", with the actual font left-indented by "x" logical at the actual position of the y - cursor.
C++ Builder:
bool __fastcall PrintMemo (TMemo *m,AnsiString
headline);
bool __fastcall PrintMemo (TMemo *m); // Without
headline
Delphi:
function PrintMemo (m : TMemo;uber : AnsiString) : boolean;
function PrintMemo (m : TMemo) : boolean; // Without
headline
This method prints the contents of the handed over TMemo - Object provided with the headline "headline" at the position where the y - cursor actually is.
C++ Builder:
bool __fastcall PrintTable (AnsiString
s [],int x_count,int y_count,AnsiString headline);
bool __fastcall PrintTable (AnsiString s [],int x_count,int y_count);
Delphi:
function PrintTable (s : Array of AnsiString; x_count :integer;y_count
:integer) : boolean;
function PrintTable (s : Array of AnsiString;x_count : integer;y_count
: integer; uber : AnsiString) : boolean;
This method prints the contents of the Arrays s in table order, x_count
contains the count of columns. "x_count" must contain either the values
2 or 4 (two or four columns), y_count contains the count of rows in s.
The columns are internally so compute, that the largest item is fitting
in.
"Headline" contains a optional headline. The first and the third column
are printed with the font "BoldFont". If you do
not wish that, put "BoldFont" with the function "Assign" to "NormalFont".
C++ Builder:
bool __fastcall PrintList (TListBox
*t);
bool __fastcall PrintList (TListBox *t,AnsiString headline);
Delphi:
function PrintListBox (t : TListBox;uber : AnsiString) : boolean;
function PrintListBox (t : TListBox) : boolean;
This mehod prints the contents of a handed over TListBox - object inclusing an optional headline.
void __fastcall SetPrinterIndex
(short index); // C++ Builder
procedure SetPrinterIndex (index : integer); // Delphi
This method sets the variable "PrinterIndex" (see Delphi or C++ Builder help, it is useful if the printer dialog should not appear (the printing starts immediatly)).
int __fastcall GetPrinterIndex
(); // C++ Builder
function GetPrinterIndex : integer; // Delphi
This method returns the actual value of the variable "PrinterIndex".
void __fastcall PrintEnd (); //
C++ Builder
procedure PrintEnd; // Delphi
This method is finishing the print and must be called whenever "PrintInit" was called before.
C++ Builder:
bool __fastcall Print (TListView *tl);
bool __fastcall Print (TTreeView *tv);
bool __fastcall Print (TListView *tl,int from,int to);
bool __fastcall Print (TTreeView *tv,int from,int to);
Delphi:
function Print (tv : TTreeView) : boolean;
function Print (tv : TTreeView;from : integer;utl : integer) : boolean;
function Print (tl : TListView;from : integer; utl : integer) :
boolean;
function Print (tl : TListView) : boolean;
This method prints the contents of a handed over TListView- or TTreeView
- Object, the optional parameters "from" and "to" indicate the index of
the items you want to print. For example the values 5,100 mean, that from
the 5th up to the 100th item all items are printed.
The ListView-Object must have the ViewStyle "vsReport".
See also "Options".
int __fastcall GetPageHeight ();
// C++ Builder
function GetPageHeight : integer; // Delphi
This method returns the height of the page in physical pixel (instead of logical pixel)
int __fastcall GetPageWidth ();
// C++ builder
function GetPageWidth : integer; // Delphi
This method returns the width of the page in physical pixel (instead of logical).
void __fastcall NewPage (); //
C++ Builder
procedure NewPage; // Delphi
This methods triggers a new page.
bool __fastcall PrintInit ();
//
C++ Builder
function PrintInit : boolean; // Delphi
This method must be called if you start a printing operation and you want to print more than one Object, in either case this function is called internally. If you call this method, you will always have to call at the end of the printing process "PrintEnd". If the user aborts the printer dialog, "PrintInit" returns "FALSE", otherwise "TRUE". If you want to prevent the printer dialog, call "SetPrinterIndex" before "PrintInit".
Sample:
void SampleApplication.PrintSample_1 ()
{
EasyPrint->Print (TreeViewObject);
// Only one Object is printed, no call to PrintInit ()
}
void SampleApplication.PrintSample_2 ()
{
if (!EasyPrint->Init ()) return;
// More than one printing operation, a call to "PrintInit" is nescessary
EasyPrint->Print (TreeViewObject);
EasyPrint->NewLine ();
EasyPrint->Print (ListViewObject);
EasyPrint->PrintEnd ();
// Don't forget a call to "PrintEnd ()"
}
void __fastcall SetFont (TFont *f);
//
C++ Builder
procedure SetFont (f : TFont); // Delphi
This method changes the current font by assigning the adjusted values of the handed over TFont - object to the current font object.
void __fastcall GetFont (TFont *f);
// C++ Builder
procedure GetFont (f : TFont); // Delphi
This method returns the current font in "TFont". TFont must be a valid object.
int __fastcall GetColumn ();
//
C++ Builder
function GetColumn : integer; // Delphi
If a table is just printed (see "PrintTable"), this method returns the
current column.
If there are just header lines printed, this methods returns "0" for
left - aligning header lines and "1" for right - aligning header lines.
If there is just a TListView - Object to be printed with the
method "Print", the current column is returned, if
a TTreeView - Objekt is printed, this method returns the level of the current
item to be printed. In all other cases the return value is undefined.
int __fastcall GetRow (); //
C++ Builder
function GetRow : integer; // Delphi
If there is a table just to be printed (see "PrintTable"), this method
returns the current row.
If there are header lines just to be printed, this method returns -3
for the first header line and -2 for the second header line.
If there is a TListView- or a TTreeView- object to be printed
with the method "Print", the current row is returned.
In all other cases the return value is undefined.
C++ Builder:
void __fastcall NewLine (double t);
void __fastcall NewLine ();
Delphi:
procedure NewLine (t : double);
procedure NewLine;
This method triggers a new line. If you provide a factor in the variable
"t", "LineSpacing" will be muliplicated
with this factor, for getting a line spacing different from the current
default value.
Delphi:
function PrintTStrings (ts : TStrings;headline : AnsiString) : boolean;
overload;
function PrintTStrings (ts : TStrings) : boolean; overload;
This method prints the contents of the TStrings - object "ts" with an
optional headline (only Delphi).
ConfFileName: Name of the file, to
load the current printing properties at runtime from.
If the user should have the oportunity to change the printing shape
itself, you can write to this file the current printing properties of the
user. The file must have the format of the structure "PrintConf"
(you can find it in PrintConf.h). The properties which are provided in
this file overwrite the properties commited at design time. The program
"printconf.exe" comes with sourcecode as C++ Builder 4 project, or
"printconf5.exe" as C++ Builder 5 project. It shows how to manage the properties
of the printing parameters for the EasyPrint - Package. You can use
this program directly or you can use it modified.
FrameLines: Properties for the frame lines
Bottom: Spacing between the bottom frame line and the bottom edge of the page in logical pixels.
Left: Spacing between the left frame line and the left edge of the page in logical pixels.
Pen: line art und solidation of the frame lines
PrintBottomFrameLine: Should the bottom frame line be printed?
PrintLeftFrameLine: Should the left frame line be printed?
PrintRightFrameLine: Should the right frame line be printed?
PrintTopFrameLine: Should the top frame line be printed?
Header1: Text of the first header line
Header1Font: Font of the first header line
Header2: Text of the second header line
Header2Font: Font of the second header line
HeadLineFont: Font for headlines
LineSpacing: Line spacing as a value multiplicated with the height of a fictive row printed with the current font.
Margins: Space from the edges of the page
in
logical pixels.
The values in "Margins" built a rectangle in which all printing will
happen.
Bottom: bottom logical edge
Left: left logical edge
Right: right logical edge
Top: top logical edge
TreeView: Options for printing the contents of a TreeView - Control:Indent: Indent in logical pixel for every level of the tree
Numbering: Scientific numbering of the particular items of the TreeView
ParentHeadLine: If an item has "children" (a parent node is), he is printed with the font "HeadLineFont"
Pen: kind of line for PrintLines
PrintImages: the icons of the TreeView are printed
PrintLines: The particular items of the TreeView - Control are printed with connected lines (like they appear on the screen).
PrintStateImages: The "State" - icons of the TreeView - Control are printed (if there are any).
PrintLogo: You can print on every
page a bitmap (your logo)
Bitmap: TBitmap - object to be printed
Bottom, Left, Right, Top: Rectangle in logical pixels, in which the bitmap will be printed.