HDocs_Printer Unit
ThDocs_Printer
This class provides a component for managing document printing operations within an application.It is designed to handle configuration, initialization, and execution of print jobs for various types of documents.
The component includes methods for setting up print settings, generating printable content, and executing the print process.
It supports integration with other application modules to allow automated or user-driven printing tasks.
Parameters and properties allow customization of document appearance, printer selection, and additional printing options.
Start_A4_Job
Initializes a new print job for an A4 document. Allows selection of page orientation, logo display, and page footer inclusion.Also sets the job title for identification or display purposes.
Procedure Start_A4_Job(Portrait, EnaLogo, EnaPageFooter: Boolean; Job_Title: String);
Parameters
- Portrait: Boolean; Set to True for portrait orientation, False for landscape.
- EnaLogo: Boolean; Enable or disable printing a logo on each page.
- EnaPageFooter: Boolean; Enable or disable printing the page footer.
- Job_Title: String; The title assigned to the print job.
Finish_A4_Job
Completes the current A4 print job and executes a final action, such as previewing or printing.Allows selection of the desired final action using an enumeration parameter.
Function Finish_A4_Job(Action: ThDocs_Printer_Action = he_Preview_Document): Boolean;
Parameters
- Action: ThDocs_Printer_Action; Specifies the final action for the print job, such as preview or direct print.
The default is he_Preview_Document.
Return Value
Returns True if the print job completed successfully.Returns False if an error occurred or the action failed.
ThDocs_Printer_Action
This enumeration defines the available actions that can be performed when finalizing a print job.Each value specifies a different way to handle the output or user interaction at the end of the print process.
ThDocs_Printer_Action = (he_Preview_Document, he_Print_Directly, he_Print_Directly_No_Dialog, he_EMail_Directly, he_ConfirmDialog);
Values
- he_Preview_Document: Opens a preview of the document before printing.
- he_Print_Directly: Sends the document directly to the printer using the default print dialog.
- he_Print_Directly_No_Dialog: Prints the document immediately without showing any dialog.
- he_EMail_Directly: Exports or sends the document via email automatically.
- he_ConfirmDialog: Displays a confirmation dialog before proceeding with the action.
Finish_A4_Job_As_PDF
Finalizes the A4 print job and exports the output as a PDF file.The file name and output resolution can be specified for the generated PDF.
Function Finish_A4_Job_As_PDF(FileName: String; DPI: ThPrint_Resolution): Boolean;
Parameters
- FileName: String; The full path and file name for the PDF output file.
- DPI: ThPrint_Resolution; Sets the resolution (dots per inch) for the exported PDF.
ThPrint_Resolution = (he_200dpi, he_300dpi, he_600dpi);
Return Value
Returns True if the PDF was created successfully.Returns False if the export failed.
Start_Envelope_Job
Begins a print job for an envelope with custom dimensions. Sets the width and height in millimeters for the print area.Procedure Start_Envelope_Job(Width_Mm, Height_Mm: Double);
Parameters
- Width_Mm: Double; The width of the envelope in millimeters.
- Height_Mm: Double; The height of the envelope in millimeters.
Finish_Envelope_Job
Completes the envelope print job. Executes the final output process for the envelope document.Function Finish_Envelope_Job: Boolean;
Return Value
Returns True if the envelope job completed successfully.Returns False if the operation failed.
Start_PRO_Printer_Job
Initializes a professional printer job with custom width and logical page height in millimeters.Allows enabling a logo and setting the printer's pixels per millimeter (PPMM). Used for specialized or advanced printing devices.
Procedure Start_PRO_Printer_Job(Width_Mm, Logical_Page_Height_Mm: Double; EnaLogo: Boolean; Ppmm: Byte = 7);
Parameters
- Width_Mm: Double; The width of the print area in millimeters.
- Logical_Page_Height_Mm: Double; The logical height of the page in millimeters.
- EnaLogo: Boolean; Enables or disables logo printing.
- Ppmm: Byte; Sets the printer resolution in pixels per millimeter (default is 7).
Finish_PRO_Printer_Job
Finalizes the professional printer job and processes the print output.Allows specifying left and top offsets as well as a debug mode.
Function Finish_PRO_Printer_Job(LeftOffset, TopOffset: Word; DebugMode: Boolean): Boolean;
Parameters
- LeftOffset: Word; The left offset in printer units for output alignment.
- TopOffset: Word; The top offset in printer units for output alignment.
- DebugMode: Boolean; Enables debug output or special processing for testing.
Return Value
Returns True if the job completed successfully.Returns False if there was an error.
Start_POS_Thermal_Printer_Job
Begins a print job for a POS thermal printer.Allows enabling a logo and assigning a job title.
Used for receipt or ticket printing.
Procedure Start_POS_Thermal_Printer_Job(EnaLogo: Boolean; Job_Title: String);
Parameters
- EnaLogo: Boolean; Enables or disables logo printing on the receipt.
- Job_Title: String; Sets the title for the print job.
Finish_POS_Thermal_Printer_Job
Completes the POS thermal printer job.Executes the print or final output process for the thermal document.
Function Finish_POS_Thermal_Printer_Job: Boolean;
Return Value
Returns True if the job completed successfully.Returns False if the operation failed.
NewPage
Starts a new page in the current print job.This procedure finalizes the current page and prepares the print engine for adding content to the next page.
Procedure NewPage;
Sign_This_A4_Page_As_Last
Marks the current A4 page as the last page of the document.Allows optional printing of a logo and page footer on this last page.
Procedure Sign_This_A4_Page_As_Last(EnaLogo, EnaPageFooter: Boolean);
Parameters
- EnaLogo: Boolean; Enables or disables logo printing on the last page.
- EnaPageFooter: Boolean; Enables or disables the page footer on the last page.
Begin_Grid
Begins the definition of a custom grid for tabular data in the print job.Specifies column widths, whether to draw default lines, space from the top, and minimum height constraints.
Procedure Begin_Grid(Cols: Array OF Double; Def_Draw_Lines: Boolean; Space_From_Top, Minimal_Height_Demands: Double);
Parameters
- Cols: Array OF Double; An array specifying the width of each column in the grid (in millimeters).
- Def_Draw_Lines: Boolean; Enables or disables drawing default lines between columns and rows.
- Space_From_Top: Double; The distance from the top of the page to the grid start (in millimeters).
- Minimal_Height_Demands: Double; The minimum required height for the grid (in millimeters).
Begin_Grid_Div_Width
Starts a grid by dividing a total width into equal columns, with control over first column width, overall grid width, line drawing, spacing, and minimal height.Procedure Begin_Grid_Div_Width(ColsCount: Byte; FirstColWidth, WholeWidth: Double; Def_Draw_Lines: Boolean;
Space_From_Top, Minimal_Height_Demands: Double);
Parameters
- ColsCount: Byte; The number of columns in the grid.
- FirstColWidth: Double; Width of the first column (in millimeters).
- WholeWidth: Double; Total width of the grid (in millimeters).
- Def_Draw_Lines: Boolean; Enables or disables default line drawing for the grid.
- Space_From_Top: Double; Space from the top of the page before the grid starts (in millimeters).
- Minimal_Height_Demands: Double; Minimum height required for the grid (in millimeters).
Begin_Grid_For_Table
Begins a grid specifically prepared for standard table layouts.Sets the number of columns, space from the top, and the minimal height required.
Procedure Begin_Grid_For_Table(ColsCount: Byte; Space_From_Top, Minimal_Height_Demands: Double);
Parameters
- ColsCount: Byte; The number of columns in the table.
- Space_From_Top: Double; Distance from the top of the page to the table (in millimeters).
- Minimal_Height_Demands: Double; The minimum required height for the table (in millimeters).
Column_Props
Sets properties for a specific column in the grid or table.Allows configuration of the column's title, line drawing, associated table object, and optional custom width.
Procedure Column_Props(Col: Byte; FnTitle: String; Draw_Lines: Boolean; HTable: ThTable; ColWidth: Double = -1);
Parameters
- Col: Byte; The index of the column to configure.
- FnTitle: String; Title or caption to be used for the column.
- Draw_Lines: Boolean; Enables or disables line drawing for this column.
- HTable: ThTable; Associated table object for advanced grid features.
- ColWidth: Double; Optional custom width for the column (default is -1 for automatic width).
Column_Lines
Sets the appearance of lines for a specific column, including left, right, and bottom lines.Procedure Column_Lines(Col: Byte; Left_Line, Right_Line, Bottom_Line: Boolean);
Parameters
- Col: Byte; The column index to configure.
- Left_Line: Boolean; Enables or disables the left border line for the column.
- Right_Line: Boolean; Enables or disables the right border line for the column.
- Bottom_Line: Boolean; Enables or disables the bottom border line for the column.
Table_Header
Renders the header for the current table or grid.Optionally centers the title text in the header.
Procedure Table_Header(Center_Title_Text: Boolean = False);
Parameters
- Center_Title_Text: Boolean; If True, the header title is centered.
Default is False.
Column_Title
Returns the title text assigned to a specific column.This function provides access to the caption or label set for the given column index.
Function Column_Title(Col: Byte): String;
Parameters
- Col: Byte; The index of the column whose title is requested.
Return Value
Returns the title text of the specified column as a String.Render_Row
Renders a single row in the table or grid.Allows specification of a bottom horizontal line and fixed row height.
Procedure Render_Row(Bottom_Horz_Line: Boolean; Fixed_Height: Double = 0);
Parameters
- Bottom_Horz_Line: Boolean; Enables or disables drawing a horizontal line at the bottom of the row.
- Fixed_Height: Double; Specifies a fixed height for the row (in millimeters). If set to 0, the height is determined automatically.
Begin_Title
Begins a title section in the document using custom column widths.Sets the vertical spacing from the top and minimal height requirements.
Procedure Begin_Title(Cols: Array OF Double; Space_From_Top, Minimal_Height_Demands: Double);
Parameters
- Cols: Array OF Double; An array defining the width of each column for the title section (in millimeters).
- Space_From_Top: Double; Distance from the top of the page to the title section (in millimeters).
- Minimal_Height_Demands: Double; Minimum required height for the title section (in millimeters).
Render_Title
Renders the title section previously defined in the document layout.This procedure draws the title area using the specified column configuration and layout properties.
Procedure Render_Title;
Column_Height_After_Render_Row
Returns the height of a specific column after rendering a row.This function is used to query the actual height consumed by a column following the rendering process.
Function Column_Height_After_Render_Row(Col: Byte): Double;
Parameters
- Col: Byte; The index of the column for which to get the height.
Return Value
Returns the height of the specified column as a Double (in millimeters).Background
Sets the background color for specific columns in the current table or grid row.Allows selective coloring of columns to enhance readability or highlight data.
Procedure Background(Cols: Array OF Byte; Color: TColor);
Parameters
- Cols: Array OF Byte; The indices of the columns to apply the background color to.
- Color: TColor; The color to use for the background of the specified columns.
Down
Moves the current output position down by a specified offset in selected columns.This procedure is useful for fine control of vertical spacing in tabular layouts.
Procedure Down(Cols: Array OF Byte; Offset: Double);
Parameters
- Cols: Array OF Byte; The indices of columns to apply the vertical offset.
- Offset: Double; The distance to move down in millimeters.
Text
Writes a text string in the specified column using an optional font style.Returns a Boolean value indicating if the operation was successful.
Function Text(CONST Col: Byte; CONST Text: String; CONST FontStyle: String = ''): Boolean;
Parameters
- Col: Byte; The index of the column where the text will be placed.
- Text: String; The content to display in the specified column.
- FontStyle: String; Optional font style for the text (default is empty for standard style).
Return Value
Returns True if the text was rendered successfully.Returns False if rendering failed.
Data
Writes a numerical value to a specified column, with a defined data type and optional font style.This procedure is intended for displaying formatted data such as numbers or currency.
Procedure Data(CONST Col: Byte; CONST Value: Double; CONST Kind: ThDataType; CONST FontStyle: String = '');
Parameters
- Col: Byte; The index of the column where the data will be placed.
- Value: Double; The numeric value to display.
- Kind: ThDataType; Specifies the data type or formatting for the value.
- FontStyle: String; Optional font style for the value (default is empty for standard style).
Field_Name
Assigns a field name from a table to a specific column for use in data binding or display.Links the column with the provided field and associated table object.
Procedure Field_Name(Col: Byte; FieldName: String; HTable: ThTable);
Parameters
- Col: Byte; The index of the column to associate with the field.
- FieldName: String; The name of the field in the table.
- HTable: ThTable; The table object containing the field.
Field
Displays the value of a specified field from the chosen row of the given table.The value is displayed in the specified column.
Allows printing the field name and customizing the font style.
Procedure Field(Col: Byte; HTable: ThTable; FieldName: String; Row: Integer; PrintName: Boolean; FontStyle: String = '');
Parameters
- Col: Byte; The index of the column where the field value will be displayed.
- HTable: ThTable; The table object containing the data.
- FieldName: String; The name of the field whose value will be displayed.
- Row: Integer; The row index in the table from which to get the field value.
- PrintName: Boolean; If True, prints the field name before the value.
- FontStyle: String; Optional font style for the displayed text.
FieldExist
Checks if a specified field exists in the given table. If the field exists, its value from the specified row is displayed in the chosen column.Allows customization of font style and whether to print the field name.
Returns a Boolean value indicating if the field was found and its value displayed.
Function FieldExist(Col: Byte; HTable: ThTable; FieldName: String; Row: Integer; FontStyle: String = ''; PrintName: Boolean = True): Boolean;
Parameters
- Col: Byte; The index of the column in which to display the field value.
- HTable: ThTable; The table object to search for the field.
- FieldName: String; The name of the field to check in the table and display.
- Row: Integer; The row index in the table whose field value will be displayed.
- FontStyle: String; Optional font style for the displayed value.
- PrintName: Boolean; Whether to print the field name together with its value.
Return Value
Returns True if the field exists in the table and its value was displayed.Returns False if the field does not exist or was not displayed.
FieldExistH
Checks if a specified field exists in the given table.If the field exists, displays its value from the specified row in the chosen column, with the field name as a title before the value.
Allows customization of font style for the displayed text.
Returns a Boolean indicating whether the field was found and its value displayed.
Function FieldExistH(Col: Byte; HTable: ThTable; FieldName: String; Row: Integer; FontStyle: String = ''): Boolean;
Parameters
- Col: Byte; The index of the column in which to display the field value.
- HTable: ThTable; The table object to search for the field.
- FieldName: String; The name of the field to check in the table and display.
- Row: Integer; The row index in the table whose field value will be displayed.
- FontStyle: String; Optional font style for the displayed text.
Return Value
Returns True if the field exists in the table and its value was displayed.Returns False if the field does not exist or was not displayed.
Field_Horiz
Displays the value of a table field in a column and row, with an option to concatenate extra text.Intended for horizontal table layouts or extended text display.
Procedure Field_Horiz(Col: Byte; HTable: ThTable; FieldName: String; Row: Integer; ConcatText: String = '');
Parameters
- Col: Byte; The index of the column for output.
- HTable: ThTable; The table object containing the field.
- FieldName: String; The name of the field to display.
- Row: Integer; The row index in the table.
- ConcatText: String; Optional text to concatenate after the field value.
POS_Field
Displays the value of a specified field from the chosen row of the given table in a POS document or receipt layout.The field name is shown as a title before the value, using the format "FieldName Value".
Font style for the value and a separate style for the title can be customized.
Procedure POS_Field(HTable: ThTable; FieldName: String; Row: Integer; FontStyle: String = ''; TitleStyle: String = '');
Parameters
- HTable: ThTable; The table object containing the data.
- FieldName: String; The name of the field whose value will be displayed.
- Row: Integer; The row index in the table from which to get the field value.
- FontStyle: String; Optional font style for the value.
- TitleStyle: String; Optional font style for the field name as a title.
Barcode
Draws a barcode in the specified column using the provided text as the encoded data.The height of the barcode in millimeters can be specified.
Procedure Barcode(Col: Byte; Text: String; Height: Double);
Parameters
- Col: Byte; The index of the column where the barcode will be placed.
- Text: String; The text to encode in the barcode.
- Height: Double; The height of the barcode in millimeters.
Image
Draws an image in the specified column with the given height.You can provide the image either by specifying a folder and file name, or by passing a bitmap object.
Procedure Image(Col: Byte; Height: Double; Folder, FileName: String); Overload;
Procedure Image(Col: Byte; Height: Double; Image_Will_Be_Released: TBitmap); Overload;
Parameters
- Col: Byte; The index of the column where the image will be displayed.
- Height: Double; The height of the image in millimeters.
- Folder: String; The database objects folder where the image file is located (only for the overload with folder and file name).
- FileName: String; The file name of the image to be displayed (only for the overload with folder and file name).
- Image_Will_Be_Released: TBitmap; A bitmap object containing the image to display (only for the overload with TBitmap).
Icon
Draws an icon in the specified column, using the provided icon name (from ThBmpIcon container).The icon is displayed with the specified height in millimeters.
Procedure Icon(Col: Byte; Height: Double; IconName: String);
Parameters
- Col: Byte; The index of the column where the icon will be placed.
- Height: Double; The height of the icon in millimeters.
- IconName: String; The name of the icon to be displayed.
Step_Global_YPos_In_Mm
Moves the global vertical position by the specified step in millimeters.This procedure is used to add vertical spacing or to position the next print element lower on the page.
Procedure Step_Global_YPos_In_Mm(Step_In_Mm: Double);
Parameters
- Step_In_Mm: Double; The distance to move down in millimeters.
Horiz_Separator
Draws a horizontal separator line at a specified distance from the last vertical position on the page.Allows the option to draw a single or double line.
Procedure Horiz_Separator(Space_From_Top: Double; DoubleLines: Boolean);
Parameters
- Space_From_Top: Double; The vertical distance from the last position to the separator, in millimeters.
- DoubleLines: Boolean; If True, draws a double line instead of a single line.
Draw_Floating_Round_Rect
Draws a rounded rectangle at the specified coordinates with the given width and height, using floating (absolute) positioning in millimeters.The rectangle is rendered at the specified X and Y position, sized according to W and H.
Procedure Draw_Floating_Round_Rect(X, Y, W, H: Double);
Parameters
- X: Double; The X coordinate of the rectangle's top-left corner, in millimeters.
- Y: Double; The Y coordinate of the rectangle's top-left corner, in millimeters.
- W: Double; The width of the rectangle, in millimeters.
- H: Double; The height of the rectangle, in millimeters.
Draw_Floating_Text_Rect
Draws a rectangle at the specified coordinates and fills it with text, using floating (absolute) positioning in millimeters.You can specify text, font style, font size, and color for the displayed text.
Procedure Draw_Floating_Text_Rect(X, Y, W, H: Double; Text, FontStyle: String; FontSize: Integer; Color: TColor);
Parameters
- X: Double; The X coordinate of the rectangle's top-left corner, in millimeters.
- Y: Double; The Y coordinate of the rectangle's top-left corner, in millimeters.
- W: Double; The width of the rectangle, in millimeters.
- H: Double; The height of the rectangle, in millimeters.
- Text: String; The text to display inside the rectangle.
- FontStyle: String; The font style to apply to the text.
- FontSize: Integer; The font size of the text.
- Color: TColor; The color of the text.
Draw_Floating_FillRect
Draws a filled rectangle at the specified coordinates using the provided brush color, with floating (absolute) positioning in millimeters.Drawing can be forced regardless of conditions by setting DoItAnyway to True.
Procedure Draw_Floating_FillRect(X, Y, W, H: Double; BrushColor: TColor; DoItAnyway: Boolean);
Parameters
- X: Double; The X coordinate of the rectangle's top-left corner, in millimeters.
- Y: Double; The Y coordinate of the rectangle's top-left corner, in millimeters.
- W: Double; The width of the rectangle, in millimeters.
- H: Double; The height of the rectangle, in millimeters.
- BrushColor: TColor; The color used to fill the rectangle.
- DoItAnyway: Boolean; If True, the rectangle will be drawn regardless of checks.
Draw_Floating_Image
Draws an image at the specified coordinates and size using floating (absolute) positioning in millimeters.The image is provided as a TGraphic object.
Procedure Draw_Floating_Image(X, Y, W, H: Double; CONST Image: TGraphic);
Parameters
- X: Double; The X coordinate of the image's top-left corner, in millimeters.
- Y: Double; The Y coordinate of the image's top-left corner, in millimeters.
- W: Double; The width of the image, in millimeters.
- H: Double; The height of the image, in millimeters.
- Image: TGraphic; The image object to draw.
Fields_Area
Draws a pre-defined area containing multiple fields, as specified by the ThFieldsArea object.This procedure is used to render complex layouts or grouped data fields in a single call.
Procedure Fields_Area(FA: ThFieldsArea);
Parameters
- FA: ThFieldsArea; The fields area object defining the layout and data to display.
Data_Grid
Draws an entire data grid on the document using the layout and content defined by the ThDataGrid object.This procedure renders the table or grid structure, including rows, columns, and their data, as described by the data grid definition.
Procedure Data_Grid(DG: ThDataGrid);
Parameters
- DG: ThDataGrid; The data grid object that defines the structure and contents to render.
Compress_Margin_On_Paper
Specifies the margin compression value on the printed paper, in printer units.This property allows reducing or adjusting the margin size on the output document.
Property Compress_Margin_On_Paper: Word;
Printer_Device_Name
Defines the name of the printer device to be used for printing.This property allows selecting or querying the target printer by its device name.
Property Printer_Device_Name;
Page_Width_Mm
Returns the width of the page in millimeters.This property is read-only.
Property Page_Width_Mm: Double;
Page_Height_Mm
Returns the height of the page in millimeters.This property is read-only.
Property Page_Height_Mm: Double;
Ypos
Gets or sets the global vertical position (Y coordinate) in millimeters on the current page.Allows reading the current position or setting a new vertical position for drawing operations.
Property Ypos: Double;
Draw_Logo_On_Demand
Specifies an event handler that is triggered to draw a logo on the document when needed.Use this event to provide custom logo rendering at specific stages of the print process.
Property Draw_Logo_On_Demand: TNotifyEvent;
Send_By_EMail
Specifies an event handler to send the generated document by email.This event allows integration with custom email delivery logic or automation after printing.
Property Send_By_EMail: ThdpEMailEvent;
ThdpEMailEvent
Defines an event handler type for sending a document by email.Provides information about the document name, PDF file name, and the print action, and allows confirming whether the email was sent.
ThdpEMailEvent = Procedure (Doc_Name, PDF_Fn: String; Action: ThDocs_Printer_Action; VAR Send_Confirmed: Boolean) OF Object;
Parameters
- Doc_Name: String; The name of the document to be sent.
- PDF_Fn: String; The file name of the PDF document to attach or send.
- Action: ThDocs_Printer_Action; The action that triggered the email event.
- Send_Confirmed: Boolean; Set to True if the email was sent successfully; otherwise, set to False.
rt_SB_Msg_Ptr
Pointer to a status bar message table, used for displaying status or messages.This value should be assigned from outside the component.
rt_SB_Msg_Ptr: ThTable_Statusbar_Msg;
rt_Website
Stores the website address associated with the print job or component.This value will not be modified by the component.
rt_Website: String;
rt_This_Job
Holds the temporary job data for the current print job.The data in this structure is reset at the beginning of each new job.
rt_This_Job: ThTemp_Job_Data;
ThTemp_Job_Data
Stores temporary data and configuration for the current print job.This record holds information such as client and agency IDs, document title, language, and logo options.
Includes flags for international jobs, paper usage, and custom logo formatting.
Provides a procedure to clear or reset all fields.
ThTemp_Job_Data = RECORD
Client, Agency: Integer;
Title: String;
International: Boolean;
Not_For_Paper: Boolean;
Language: ThTranslation_Language;
Logo_Format: Integer;
Procedure Clear;
End;
Fields
- Client: Integer; The client ID associated with the print job.
- Agency: Integer; The agency ID, used for logo selection.
- Title: String; The title or description for the print job.
- International: Boolean; Indicates if the job is for international use (affects logo selection).
- Not_For_Paper: Boolean; If True, the job is not intended for paper output, but for preview or PDF; replaces stationery with a normal logo.
- Language: ThTranslation_Language; The language setting for the print job.
- Logo_Format: Integer; Determines the logo format for correct client app printing.
rt_Settings
Contains the font and color configuration settings for the document printer component.This structure defines visual parameters such as font styles and color schemes.
rt_Settings: ThDocs_Printer_Settings;
ThDocs_Printer_Settings
Defines the configuration settings for fonts and colors used by the document printer component.This record contains options for font names, sizes, color schemes, and layout directions.
It also includes settings for background filling and grid appearance.
ThDocs_Printer_Settings = PACKED RECORD
Font_Name: String;
Base_Size: Word;
Text_Size: Word;
FldName_Size: Word;
MidTitle_Size: Word;
Title_Size: Word;
Right_To_Left: Boolean;
FldName_Color: TColor;
Grid_Lines_Color: TColor;
Table_Header_Bg_Color: TColor;
DO_NOT_Fill_Bg_Color: Boolean;
End;
Fields
- Font_Name: String; The name of the font to use for text rendering.
- Base_Size: Word; The base font size; used for standard and small font functions.
- Text_Size: Word; The font size for general text content.
- FldName_Size: Word; The font size for field names.
- MidTitle_Size: Word; The font size for middle-level titles.
- Title_Size: Word; The font size for main titles.
- Right_To_Left: Boolean; If True, enables right-to-left layout and text rendering.
- FldName_Color: TColor; The color used for field names.
- Grid_Lines_Color: TColor; The color used for grid lines.
- Table_Header_Bg_Color: TColor; The background color for table headers.
- DO_NOT_Fill_Bg_Color: Boolean; If True, disables background color filling; mainly for A4 printing.
Force_Default_Font
Sets a default font name and size to be used for printing. This overrides the current font settings for the job.Passing empty parameters disables this feature and restores normal font selection.
Returns a Boolean value indicating if the override was set successfully.
Function Force_Default_Font(FontName: String; FontSize: Word): Boolean;
Parameters
- FontName: String; The name of the font to set as default.
- FontSize: Word; The size of the font to set as default.
Return Value
Returns True if the default font override was set.Returns False if the feature was disabled or not applied.
Reset_Settings_Back_To_Default
Resets all print settings back to their default values.This procedure is called internally when aborting or finishing a job.
Procedure Reset_Settings_Back_To_Default;
Set_Font_Base_Size
Sets a new base font size for all text in the print job.The new base size affects the overall appearance and scaling of text.
Procedure Set_Font_Base_Size(NewBaseSize: Word);
Parameters
- NewBaseSize: Word; The new base font size to use for text rendering.
Shrink_Font_Size
Enables or disables automatic shrinking of the font size for the print job.When enabled, text may be reduced to fit within available space.
Procedure Shrink_Font_Size(Enabled: Boolean);
Parameters
- Enabled: Boolean; Set to True to enable font shrinking, or False to disable.
Set_Other_Language_Then_Default
Sets the print job to use a different language than the default system or application language.This allows dynamic switching of the print language for multilingual documents.
Procedure Set_Other_Language_Then_Default(Language: ThTranslation_Language);
Parameters
- Language: ThTranslation_Language; The language to use for printing.
Language
Returns the currently language for the print job.This function provides access to the active translation language for document output.
Function Language: ThTranslation_Language;
Return Value
Returns the language in use as a ThTranslation_Language value.TC
Translates the specified text to the current print job language, if a translation is available.Returns the translated text as a string.
Function TC(CONST Text: String): String;
Parameters
- Text: String; The text string to translate.
Return Value
Returns the translated text as a String.Abort_Curr_Job
Aborts the current print job and discards all pending print operations.This procedure is used to immediately stop and cancel any active printing process.
Procedure Abort_Curr_Job;
Reset_Delphi_Printer
Resets the internal Delphi printer object to its default state.This procedure can be used to clear or reinitialize the printer after changes or errors.
Procedure Reset_Delphi_Printer;
Job_Is_Open
Checks if a print job is currently open and active.Returns a Boolean value indicating the print job status.
Function Job_Is_Open: Boolean;
Return Value
Returns True if a job is open.Returns False if there is no active job.
Job_Page_Count
Returns the number of pages in the current print job.This function provides access to the page count of the active job.
Function Job_Page_Count: Integer;
Return Value
Returns the number of pages in the current print job as an Integer.Flat Functions:
Set_Print_Job_Language
Sets the language for all tables in the given array.If the ON_Off parameter is True, the language is set according to the current job settings of the specified printer.
If ON_Off is False, default value is set.
Procedure Set_Print_Job_Language(Prn: ThDocs_Printer; Tbls: Array OF ThTable; ON_Off: Boolean = False);
Parameters
- Prn: ThDocs_Printer; The printer component whose current job language settings may be used.
- Tbls: Array OF ThTable; The array of tables for which to set the language.
- ON_Off: Boolean; If True, sets the tables' language according to the printer's current job settings. If False, default value is set.