OpenPetra
Free Administration Software for Non-Profits
|
The TPrinter class helps to print. More...
Public Member Functions | |
virtual void | SaveState () |
save the state before a rotation etc More... | |
virtual void | RestoreState () |
restore the state after a rotation etc More... | |
virtual void | RotateAtTransform (double ADegrees, double XPos, double YPos) |
rotate the following output by some degrees, at the given position More... | |
abstract float | LineFeed (eFont AFont) |
Line Feed; increases the current y position by the height of the given font More... | |
virtual float | LineFeed () |
Line Feed; increases the current y position by the height of the biggest last used font More... | |
float | LineFeed (float height) |
Line Feed; increases the current y position by the given height More... | |
abstract float | LineSpaceFeed (eFont AFont) |
Line Feed, but not full line; increases the current y position by half the height of the given font More... | |
abstract float | LineUnFeed (eFont AFont) |
Reverse Line Feed; decreases the current y position by the height of the given font More... | |
abstract Boolean | ValidXPos (float APosition) |
Is the given position still on the page? More... | |
abstract Boolean | ValidYPos () |
Is the current line still on the page? More... | |
abstract float | LineFeedToPageFooter () |
Jump to the position where the page footer starts. SetPageFooterSpace is used to define the space reserved for the footer. More... | |
abstract void | SetPageFooterSpace (System.Int32 ANumberOfLines, eFont AFont) |
Set the space that is required by the page footer. ValidYPos will consider this value. More... | |
abstract void | SetHasMorePages (bool AHasMorePages) |
Tell the printer, that there are more pages coming More... | |
abstract bool | HasMorePages () |
more pages are coming More... | |
abstract float | Cm (float AValueInCm) |
Converts the given value in cm to the currently used measurement unit More... | |
abstract float | PixelHorizontal (float AValueInPixel) |
Converts the given value in pixel to the currently used measurement unit, using the horizontal resolution More... | |
abstract float | PixelVertical (float AValueInPixel) |
Converts the given value in pixel to the currently used measurement unit, using the vertical resolution More... | |
abstract Boolean | PrintString (String ATxt, eFont AFont, eAlignment AAlign) |
prints into the current line, aligned x position More... | |
abstract Boolean | PrintString (String ATxt, eFont AFont, float AXPos) |
prints into the current line, absolute x position More... | |
abstract bool | PrintString (String ATxt, eFont AFont, float AXPos, float AWidth, eAlignment AAlign) |
prints into the current line, absolute x position with width and alignment More... | |
virtual bool | PrintStringWrap (String ATxt, eFont AFont, float AXPos, float AWidth, eAlignment AAlign) |
prints into the current line, absolute x position with width and alignment this method uses FCurrentXPos and FCurrentYPos to be able to continue a paragraph uses FCurrentXPos and FCurrentYPos to know where to start to print, and also sets valid values in those member variables More... | |
abstract Boolean | PrintStringAndFits (String ATxt, eFont AFont, float AXPos, float AWidth, eAlignment AAlign) |
This function uses the normal DrawString function to print into a given space. More... | |
abstract float | GetWidthString (String ATxt, eFont AFont) |
Return the width of the string, if it was printed in one line, using the given Font More... | |
abstract Boolean | DrawLine (float AXPos1, float AXPos2, eLinePosition ALinePosition, eFont AFont) |
Draws a line, either above or below the current text line the font is required to get the height of the row More... | |
virtual void | DrawLine (Int32 APenPixels, float AXPos1, float AYPos1, float AXPos2, float AYPos2) |
Draws a line, at specified position More... | |
virtual void | DrawRectangle (Int32 APenPixels, float AXPos, float AYPos, float AWidth, float AHeight) |
draws a rectangle More... | |
virtual void | DrawBitmap (string APath, float AXPos, float AYPos) |
todoComment More... | |
virtual void | DrawBitmap (string APath, float AXPos, float AYPos, float AWidth, float AHeight, float AWidthPercentage, float AHeightPercentage) |
Draw a bitmap. More... | |
TPrinter () | |
constructor More... | |
virtual void | Init (eOrientation AOrientation, TPrinterLayout APrinterLayout, eMarginType AMarginType) |
sets the orientation of the page More... | |
void | StartSimulatePrinting () |
start the simulation of printing; nothing is actually printed, but the CurrentYPos is increased More... | |
void | FinishSimulatePrinting () |
finish the simulation of printing; the actual CurrentYPos is restored More... | |
void | PushCurrentState () |
store the current printer state (font size etc) More... | |
void | PopCurrentState () |
return to previous printer state; this is used for printing table cells More... | |
void | PopCurrentStateApartFromYPosition () |
return to previous printer state; but keep the new y position (used eg. for printing the page header) More... | |
float | Inch (float AValueInInch) |
Converts the given value in inch to the currently used measurement unit; uses Inch2Cm and Cm More... | |
virtual void | InsertDocument (string AFilename) |
insert another document into the current document. At the moment only used for PDF More... | |
virtual float | PrintTable (float AXPos, float AWidthAvailable, List< TTableRowGfx >rows, out Int32 ARowsFittingOnPage) |
renders a table at the current FCurrentYPos does not support rowspan at the moment colspan might be implemented in the generation of the TTableRowGfx structure does not care about fitting on page etc. More... | |
Static Public Member Functions | |
static float | Cm2Inch (float AValueInCm) |
Converts the given value in cm to the equivalent value in inches More... | |
static float | Inch2Cm (float AValueInInch) |
Converts the given value in inches to the equivalent value in centimeters More... | |
Protected Attributes | |
eOrientation | FOrientation |
todoComment More... | |
eMarginType | FMarginType |
use printable area or default margins More... | |
Int32 | FNumberOfPages |
todoComment More... | |
float | FPageFooterSpace |
how much space is needed for the footer lines; footerspace = font.height number of lines More... | |
float | FLeftMargin |
todoComment More... | |
float | FTopMargin |
todoComment More... | |
float | FRightMargin |
todoComment More... | |
float | FBottomMargin |
todoComment More... | |
float | FWidth |
todoComment More... | |
float | FHeight |
todoComment More... | |
TPrinterLayout | FPrinterLayout |
todoComment More... | |
TPrinterState | FCurrentState = new TPrinterState() |
current state of printer More... | |
PrintAction | FprintAction |
I can check whether I'm printing to a preview or a real printer. More... | |
Properties | |
System.Int32 | CurrentPageNr [get, set] |
todoComment More... | |
System.Int32 | CurrentDocumentNr [get, set] |
a document can consist of several pages; a document is one body element More... | |
System.Int32 | NumberOfPages [get, set] |
this only has a valid value after the first rendering of the report More... | |
float | CurrentYPos [get, set] |
todoComment More... | |
float | CurrentXPos [get, set] |
todoComment More... | |
float | AnchorXPos [get, set] |
other elements can be positioned relative to this position More... | |
float | AnchorYPos [get, set] |
other elements can be positioned relative to this position More... | |
float | LeftMargin [get] |
todoComment More... | |
float | RightMargin [get] |
todoComment More... | |
eFont | CurrentFont [get, set] |
todoComment More... | |
float | CurrentLineHeight [get, set] |
1 is the normal height of the font, CurrentLineHeight is multiplied with the height of the font More... | |
float | CurrentRelativeFontSize [get, set] |
the relative font size; 0 is default size More... | |
eAlignment | CurrentAlignment [get, set] |
todoComment More... | |
ePrintingMode | PrintingMode [get, set] |
this is about simulation or printing More... | |
float | Width [get] |
todoComment More... | |
float | PageFooterSpace [get] |
todoComment More... | |
The TPrinter class helps to print.
This is a generic class for printing. Most of the functions are abstract and need to be implemented by a derived class. This is TxtPrinter and GfxPrinter, that are derived from TPrinter
|
inline |
constructor
|
pure virtual |
Converts the given value in cm to the currently used measurement unit
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inlinestatic |
Converts the given value in cm to the equivalent value in inches
|
inlinevirtual |
todoComment
APath | |
AXPos | |
AYPos |
Reimplemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TPdfPrinter.
|
inlinevirtual |
Draw a bitmap.
Either Width or WidthPercentage should be unequals 0, but only one should have a value. Same applies to Height
Reimplemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TPdfPrinter.
|
pure virtual |
Draws a line, either above or below the current text line the font is required to get the height of the row
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inlinevirtual |
Draws a line, at specified position
Reimplemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TPdfPrinter.
|
inlinevirtual |
draws a rectangle
Reimplemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TPdfPrinter.
|
inline |
finish the simulation of printing; the actual CurrentYPos is restored
|
pure virtual |
Return the width of the string, if it was printed in one line, using the given Font
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
more pages are coming
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inline |
Converts the given value in inch to the currently used measurement unit; uses Inch2Cm and Cm
|
inlinestatic |
Converts the given value in inches to the equivalent value in centimeters
|
inlinevirtual |
sets the orientation of the page
Reimplemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inlinevirtual |
insert another document into the current document. At the moment only used for PDF
AFilename |
Reimplemented in Ict.Common.Printing.TPdfPrinter.
|
inlinevirtual |
Line Feed; increases the current y position by the height of the biggest last used font
Reimplemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Line Feed; increases the current y position by the height of the given font
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inline |
Line Feed; increases the current y position by the given height
|
pure virtual |
Jump to the position where the page footer starts. SetPageFooterSpace is used to define the space reserved for the footer.
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Line Feed, but not full line; increases the current y position by half the height of the given font
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Reverse Line Feed; decreases the current y position by the height of the given font
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Converts the given value in pixel to the currently used measurement unit, using the horizontal resolution
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Converts the given value in pixel to the currently used measurement unit, using the vertical resolution
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inline |
return to previous printer state; this is used for printing table cells
|
inline |
return to previous printer state; but keep the new y position (used eg. for printing the page header)
|
pure virtual |
prints into the current line, aligned x position
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
prints into the current line, absolute x position
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
prints into the current line, absolute x position with width and alignment
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
This function uses the normal DrawString function to print into a given space.
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inlinevirtual |
prints into the current line, absolute x position with width and alignment this method uses FCurrentXPos and FCurrentYPos to be able to continue a paragraph uses FCurrentXPos and FCurrentYPos to know where to start to print, and also sets valid values in those member variables
Reimplemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inlinevirtual |
renders a table at the current FCurrentYPos does not support rowspan at the moment colspan might be implemented in the generation of the TTableRowGfx structure does not care about fitting on page etc.
AXPos | the X position to start the table |
AWidthAvailable | AWidthAvailable |
rows | |
ARowsFittingOnPage | number of rows that fitted on the page |
|
inline |
store the current printer state (font size etc)
|
inlinevirtual |
restore the state after a rotation etc
Reimplemented in Ict.Common.Printing.TPdfPrinter.
|
inlinevirtual |
rotate the following output by some degrees, at the given position
Reimplemented in Ict.Common.Printing.TPdfPrinter.
|
inlinevirtual |
save the state before a rotation etc
Reimplemented in Ict.Common.Printing.TPdfPrinter.
|
pure virtual |
Tell the printer, that there are more pages coming
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Set the space that is required by the page footer. ValidYPos will consider this value.
Implemented in Ict.Common.Printing.TGfxPrinter, Ict.Common.Printing.TPdfPrinter, and Ict.Common.Printing.TTxtPrinter.
|
inline |
start the simulation of printing; nothing is actually printed, but the CurrentYPos is increased
|
pure virtual |
Is the given position still on the page?
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
pure virtual |
Is the current line still on the page?
Implemented in Ict.Common.Printing.TGfxPrinter, and Ict.Common.Printing.TTxtPrinter.
|
protected |
todoComment
|
protected |
current state of printer
|
protected |
todoComment
|
protected |
todoComment
|
protected |
use printable area or default margins
|
protected |
todoComment
|
protected |
todoComment
|
protected |
how much space is needed for the footer lines; footerspace = font.height number of lines
|
protected |
I can check whether I'm printing to a preview or a real printer.
|
protected |
todoComment
|
protected |
todoComment
|
protected |
todoComment
|
protected |
todoComment
|
getset |
other elements can be positioned relative to this position
|
getset |
other elements can be positioned relative to this position
|
getset |
todoComment
|
getset |
a document can consist of several pages; a document is one body element
|
getset |
todoComment
|
getset |
1 is the normal height of the font, CurrentLineHeight is multiplied with the height of the font
|
getset |
todoComment
|
getset |
the relative font size; 0 is default size
|
getset |
todoComment
|
getset |
todoComment
|
get |
todoComment
|
getset |
this only has a valid value after the first rendering of the report
|
get |
todoComment
|
getset |
this is about simulation or printing
|
get |
todoComment
|
get |
todoComment