Last Revised: 01/06/25 |
This called routine can be used with PCL 5 compatible devices, typically laser or ink-jet printers, to print text, lines, and boxes. Note that CDS254 does not work with PCL 6, nor with host-based printers, where the PC host is required for processing.
See example program CDX080 for sample code.
- Printing_Text
- Printing_Vertical_Lines
- Printing_Horizontal_Lines
- Printing_Boxes
- Saving Cursor Position
- Restoring Cursor Position
- Printing an Overlay
- Printing in Color
- Printing Notepad Text
Printing Text
CALL "CDS254", Y6$, "T COL, ROW, WEIGHT, STYLE, POINT, PITCH, TYPEFACE, FILL, PATTERN", TEXT$
See Also:
CDS354 - Print 2 Column PCL Box
CDS454 - Print PCL Grid
CDS554 - Advanced PCL Grid
The string parameters following the T for text is optional, and only the fields necessary must be specified.
CDS254 | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Printing Text | |||||||||||||||||||||||||||||
COL
|
The dot column where the text should be positioned. Dot columns are specified in 300 dot per inch, so
@(10) would be the same as a COL of 300. In addition to specifying an absolute column such as 300, a column relative to the current cursor position can be specified by inserting a + or - before the number as in +300.
If the You can also optionally specify a justification parameter Note that this option currently only works for fixed spacing typefaces such as Courier, Line Printer, and Letter Gothic and Univers (a proportional typeface). Note that additional proportional typefaces are supported if their font metrics record is in file CDSM80. This file currently contains font metrics for typeface 4148 Univers at point sizes 8 through 14. Other point sizes may be used, but the spacing may not be exact due to estimated character widths. Please contact us to add font metrics for other typefaces or point sizes to the CDSM80 file. This file is replaced during an Dynamo Tools upgrade, so don't add records yourself otherwise they will be lost after an upgrade. Normally CDS254 will print text at the current font size or the size passed. However, CDS254 can also reduce the font size to insure the text fits within the space provided on the form. You request this option by specifying the maximum dots the text may take following the
Note that the |
||||||||||||||||||||||||||||
ROW
|
The dot row where printing will occur. This typically refers to the line at the bottom of the characters, as opposed to the top. Like
COL the ROW parameter may be preceded by a + or - for relative positioning.
If the |
||||||||||||||||||||||||||||
WEIGHT
|
The weight of text using a range from -7 of Ultra Thin, to 0 for normal, to 3 for Bold, and 7 for Ultra Black. Refer to Stroke Weight in a PCL reference for additional information. Note that if the
WEIGHT is not specified, then the current weight will be used. Note this is a change from a previous version of CDS254 where the weight was always reset to 0 if not passed. |
||||||||||||||||||||||||||||
STYLE
|
The style of type to use. Principally used for italics, but can also be used for other styles supported by the particular printer or device. The possible style values include:
If the |
||||||||||||||||||||||||||||
POINT
|
This parameter is used only in proportionally spaced fonts such as Univers, Arial, Helvetica, etc. and typically may be any value from .10 to 576. Normal type is usually within the range of 9 to 18 point. If not passed, the current point size will be used.
Note that for the internal bit-map line printer font of most HP printers, the
|
||||||||||||||||||||||||||||
PITCH
|
This parameter is used for fixed space fonts such as Courier and Letter Gothic. It indicates the characters per inch. It should also be set to 16.67 when using the internal line printer font. If not passed, the current pitch will be used. The
PITCH should not be specified for proportional spaced fonts. |
||||||||||||||||||||||||||||
TYPEFACE
|
This parameter indicates the typeface family to use. You can determine this parameters value by printing a PCL test font page on HP Laser printers, or referring to the HP technical documentation manuals. Some of the popular values are listed below.
If the |
||||||||||||||||||||||||||||
FILL
|
Text is typically printed in solid black. The FILL option can be used to lighten the text color as might be desired when printing text that overlays other text in the same area. FILL can range from 1 to 99. A FILL value of 20 produces lightly shaded text suitable for use as a watermark. The FILL option is available on versions of CDS254 dated on or after 01/06/25. Example. | ||||||||||||||||||||||||||||
PATTERN
|
The PATTERN describes how the FILL is rendered. The default value of 2 is often sufficient. PATTERN can have a value from 0 to 4. See the PATTERN options in the boxes section below for more details. | ||||||||||||||||||||||||||||
TEXT$
|
The text parameter is the text to be printed. You may optionally include a leading and/or trailing
+$0D0A$ to cause the cursor to be positioned automatically down to the next line. This is typically done on the last text field of each line so that the ROW value need not be passed to CDS254. This trailing
$0D0A$ will be taken into consideration for right and center justification. |
Printing Vertical Lines
CALL "CDS254",Y6$,"V COL,ROW,ROW2,WIDTH"
Printing Horizontal Lines
CALL "CDS254",Y6$,"H COL,ROW,COL2,WIDTH"
Same as for vertical lines except that COL2
indicates either the column where the line ends, or the length of the line when using the
+
prefix. The line extends below the COL
and
ROW
specified for the dots specified in the optional WIDTH
value.
Printing Boxes
CALL "CDS254","B COL,ROW,COL2,ROW2,WIDTH,FILL,PATTERN"
Note that when printing lines and boxes, the cursor position does not change.
Saving the Cursor Position
CALL "CDS254",Y6$,"S"
This call may be required before printing text in one particular location on the page, when after printing you desire the cursor back in the same position that it was previously.
Restoring the Cursor Position
CALL "CDS254",Y6$,"R"
This restores the cursor position saved previously.
Printing an Overlay
CALL "CDS254",Y6$,"O",OVERLAYFILENAME$
An overlay is a document that prints on each page. This command is used to define an overlay. The overlay will be automatically cancelled the next time the printer is reset, typically at the start and end of each print job. You may also call CDS254 with no overlay file name to cancel the overlay. Note that the overlay begins printing on the current page and since CDS084 will print an overlay named XX/faxcover.prn on the fax coverpage, you should not call CDS254 to print an overlay until after the first call to CDS094 in the NEWPAGE routine of the application. Otherwise both overlays will print on the fax coverpage.
The easiest way to create an overlay file is to design your overlay using any word processor or design software, print it to paper to insure it looks the way you want, then choose the option to print the document to a file. Then you need to do some manual file manipulation. There is a program still under development named CV200 that will edit the output file and strip out the PCL commands that reset the printer, change orientation, and other paper source related commands. If you do not do this step, then the overlay will print on its own page and not 'overlay' the other printing.
CALL "CDS254",Y6$,"Ox",FILENAME$
The x is passed to CDS095 as the parameter indicating whether or not a message should be displayed if the file cannot be opened. Defaults to "N" if not passed.
FILENAME$
is the name of the overlay file. Pass FILENAME$
as null to cancel the overlay prior to the end of the print job. You may change the overlay file by calling CDS254 again without the need to call it to cancel the initial overlay.
Example:
IF Y6.P=1 THEN CALL "CDS254",Y6$,"O","invoice.prn"
Printing in Color
CALL "CDS254",Y6$,"Ccolorcode"
CDS254 is compatible with most PCL 5c compatible color printers. Call CDS254 with the C command to change the color of subsequent operations.
Mode | Calling Format | Color code | Example | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Simple Color Mode | CALL "CDS254", Y6$, "C[color]"
|
|
CALL "CDS254", Y6$, "Cblack"
|
||||||||||||||||||
RGB colors in hexadecimal | CALL "CDS254", Y6$, "C[RRGGBB]"
|
Replace [RRGGBB] with hexadecimal RGB value |
CALL "CDS254", Y6$, "CFFA500"
|
||||||||||||||||||
RGB colors in decimal | CALL "CDS254", Y6$, "C[rrr,ggg,bbb]"
|
Replace [rrr,ggg,bbb] with decimal RGB values |
CALL "CDS254", Y6$, "C255,64,32"
|
Color Example |
---|
7000 TEST:
|
Click to view result |
Printing Notepad Text
CDS254 can be used to print Notepad (Window) Text that includes attributes including bold text, underlined text, and reverse text. Reverse text is printed in an italics font for printers that have the italic font setting specified in Printer Type Maintenance (PFM).
CALL "CDS254",Y6$,"N COL, ROW, COLSIZE, POINT, PITCH,
TYPEFACE","NotepadFileChan,TextID{,FROMLINE,TOLINE}"
Y6$
|
Printer control data from CDS084 |
N
|
"N" indicates Notepad Text command |
COL
|
Dot Column of first line of text |
ROW
|
Dot Row of first row of text |
COLSIZE
|
Optional dot columns that notepad text can be printed in |
POINT
|
Optional point size (used for proportional fonts only). If not specified CDS254 will use 10 point. If the text will not fit in the space available, then the point size will be reduced. |
PITCH
|
Optional pitch (characters per inch - used for fixed width fonts only). If not specified CDS254 will use 10 cpi. If the text will not fit in the space available, then the pitch will be increased. |
TYPEFACE
|
Optional typeface. If not specified, notepad text that has no line drawing characters will be printed in typeface 4148 (Univers); notepad text that contains any line drawing characters will be printed in typeface 4099 (Courier). |
NotepadFileChan
|
Required file name or channel number of notepad text file already open. |
TextID
|
Required TextID of the notepad text |
FROMLINE
|
Optional starting line# within the notepad text to begin printing at. If not provided, the entire notepad will be printed, and must fit on the page at the ROW indicated. If provided, this is the starting line# of the notepad text |
TOLINE
|
Optional ending line# within the notepad text. This would be the last line# printed. Will print to end of notepad if not provided. |
CDS254 will not report an error if unable to OPEN the NotepadFile nor if the TextID is not on file.
Notepad Text Example Notepad Text with TextID of "PROMOT" from Notepad Text File DCCW15 will print at dot column 0, dot row 100. |
4600 TEST:
|