Last Revised: 04/25/12 |
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", 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.
Printing Vertical Lines
CALL "CDS254",Y6$,"V COL,ROW,ROW2,WIDTH"
Printing Vertical Lines | |
---|---|
COL
|
Dot column for upper left corner of line as described above
Note that the |
ROW
|
Dot row for upper left corner of line as described above
Note that the |
ROW2
|
Dot row for lower left corner of line. If specified with a + prefix, then this indicates the relative length of the line in dots, as opposed to an absolute row number when the line should end. |
WIDTH
|
The width of the line in dots. If not specified, one dot row will be used. Note that the width of the line extends to the right of the
COL and ROW parameters specified. |
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"
Printing Boxes | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
COL
|
Indicates the dot column for the upper left corner of the box. This value is required and the + or - prefix may not be used. | ||||||||||||
ROW
|
Indicates the dot row for the upper left corner of the box. This value is required and the + or - prefix may not be used. | ||||||||||||
COL2
|
Indicates the dot column for the lower right corner of the box. An absolute number for a specific dot column may be used, or if preceded by + then the
COL2 value represents the width of the box in dots. |
||||||||||||
ROW2
|
Indicates the dot row for the lower right corner of the box. An absolute number for a specific dot row may be used, or if preceded by
+ then the ROW2 value represents the height of the box in dots. |
||||||||||||
WIDTH
|
The width of the lines that make up the box. Note that the lines of the box always extend in toward the center of the box from all four sides. If not specified, a single dot width is assumed. | ||||||||||||
FILL
|
An optional parameter used to fill the box with some pattern. The value of the fill parameter depends upon the
PATTERN value. If the PATTERN value is 2 then the
FILL value represents the percentage of shading from 1 to 100%.
Note that there are actually only 8 shading patterns supported for most laser printers. Usually only the lightest shading is appropriate when printing text in the same box.
When the There are 6 patterns typically available.
|
||||||||||||
PATTERN
|
The fill pattern to use.
|
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:
|