TE Edit Control .NET Core / .NET Framework Help
Product page

TerMergePrint

Print a document without invoking the editing session.

static bool TerMergePrint(ref prt)
tc.StrPrint prt;Print request parameter structure.

Description: This function is used to print a buffer or a file to a specified printer or window device context and at a specified location on the page. If requested, this function can replace the field names with field data. The print parameter structure (StrPrint) is used to specify the printing parameters.

struct StrPrint {  
  char       InputType;
  string     file;
  string     buffer;
  Graphics   gr;
  bool       IsPrinter
  Rectangle  rect;
  bool       FullPage;
  int        StartPos;
  bool       OnePage;
  int        NextPos;
  string     MergeFields;
  string     MergeData;
  bool       PrintHiddenText;
  bool       PrintMarginArea;
  Form       parnt;
  int        NextY;
}

Member Variables:

InputType: This flag specifies the input type. If you wish to specify a disk file name, set the 'InputType' to 'F'. Conversely, if you wish to pass the text in a buffer, set this field to 'B'.
file:If the 'InputType' is 'F', specify the input file path name in this field.
buffer: If the 'InputType' is 'B', specify the document data using this variable..
gr:The graphics object of the printer or the window to print the text. Set to null to print to the default printer.
IsPrinter:Set to true if the graphics object specified by the 'gr' member variabe corresponds to a printer.
rect: This field contains the rectangle co-oridnates to print to. The rectangle co-ordinates are specified in the millimeter (mm) units. For a higher precision, you can specify the rectangle coordinates in twips units by specifying the negative values for the left, right, top and bottom variables in the rect structure.
FullPagePrint full page. This argument is used only when printing to the default printer (gr = null); The 'rect' variable is not used when FullPage is set to true.
StartPos:The positive value for this field specifies the character position to begin the printing. The negative value specifies the page number to begin printing. Set to 0 to begin the printing from the first page.
OnePage:Set this variable to true to print one page only. When this variable is set to false, the editor prints the entire document by spooling each page.
NextPos: (OUTPUT) The editor returns the character position of the next page to be printed. When the entire document is printed, the editor sets this field to 0.
MergeFields:This field specifies the variable to a list of mail merge field names. Each field name must be separated by a '|' character. The list must be terminated by a null character. If you do not wish to merge field data, set this field to null.
MergeData: This field specifies the variable to a list of mail merge data strings. Each data string must be separated by a '|' character. The number of data elements in the 'MergeData' array MUST be the same as the number of elements in the 'MergeFields' array. The list must be terminated by a null character. If you do not wish to merge field data, set this field to null.
PrintHiddenText: Set this field to true to print any hidden text.
PrintMarginArea:Print margin and header/footers.
parent:Parent window form.
NextY:(OUTPUT) The field returns the Y pixel position on the device context after printing.

Return Value: This function returns a true value when successful.