Specifying sequences

Using XDC Editor, you can specify PDL statements for a set of predefined sequence names. The sequences are bits of printer programming languages that are represented as XML. Before you attempt to modify a sequence, be aware of the associated PDL sequence conventions.

PDL sequences

PDL sequences are short PDL sequences that Output injects into the PDL syntax that is sent to the printer at specific points in the print job, such as at the beginning of a page or a record. Output adds the PDL sequences to perform events, such as starting a print job, starting a new document within a print job, or simply drawing a line.

Each sequence is associated with a name that uniquely identifies the sequence. XDC Editor lets you modify the sequences that are associated with predefined names. (See Predefined variables.)

Predefined variables

The XDC files include several predefined variables, such as sequence names and printer-specific values.

Sequence names

The XDC files that are delivered with your installation contain predefined sequences. If required, you can use XDC Editor to modify these sequences. The names defined for PostScript and PCL XDC files differ from the names defined for label printer XDC files.

This table describes the predefined sequence names for PostScript and PCL XDC files.

Name

PostScript

PCL

When a sequence is invoked

preDoc

Yes

Yes

To set up the printer for the document. The sequence is invoked after the preamble sequence but before the preRecord sequence. XDC Editor does not enable editing the preamble sequence.

postDoc

Yes

Yes

To set up the printer after the document. The sequence is invoked after the postRecord sequence but before the postamble sequence.

preRecord

Yes

Yes

To set up the printer before every record. A record is a repeating set of data. Typically, a record holds the data from a single form instance.

postRecord

Yes

Yes

To set up the printer after every record.

prePage

Yes

Yes

To set up the printer before every page.

postPage

Yes

Yes

To set up the printer after every page.

paginationSimplex

Yes

Yes

To set up long-edge duplex. The result of this setting is to impose each consecutive pair of pages to enable binding on the long edge.

paginationDuplex 
ShortEdge

Yes

Yes

To set up short-edge duplex. The result of this setting is to impose each consecutive pair of pages to enable binding on the short edge.

pagination

Yes

N/A

To set up the printer pagination feature, such as duplex.

stapleOn

Yes

Yes

To enable the printer’s staple feature.

stapleOff

Yes

Yes

To disable the printer’s staple feature.

staple

Yes

N/A

To staple the document.

jogNone

Yes

Yes

To disable the printer’s jog feature.

jogPageSet

Yes

Yes

To enable the printer’s jog feature.

jog

Yes

N/A

To jog the tray.

This table describes the predefined sequence names for Zebra XDC files.

Name

When a sequence is invoked

startDoc

Not applicable.

endDoc

Not applicable.

startPage

To set up the printer at the start of each page.

endPage

To set up the printer at the end of each page.

carat

To specify the name of the instruction prefix character. Most ZPL commands are prefixed by the caret (^) character, such as ^A, ^B1, ^B2, and so on.

Some older Zebra printer models may erroneously interpret the default ^ character as the second byte of a double-byte Japanese character. This case is the only one in which you should need to change the default ^ character.

You can change this character to another character, such as the exclamation mark (!). The ^ character is substituted with the character you specify, such as !A, !B1, !B2, and so on.

tilde

To execute control instructions that cause the printer to take a specific action immediately, such as clearing the memory or feeding a blank label.

copy

To specify the number of copies.

Variables resolved

XDC files for PRC printers use variables to specify font size or font pitch typeface (font) characteristics. These variables are described in the Identify escape sequences that specify printer-resident fonts (PCL only) section.

Use of variables in sequences

A sequence can use var elements that have corresponding XCI settings. Developers can specify these XCI settings in a process or by using the Output API. At run time, the Output server substitutes the variable in the XDC file with the value specified in the equivalent XCI setting. Examples of variables that map to XCI settings include those in this table:

Sequence name

Variable name

Equivalent XCI setting

copy
<var name="numCopies" />
setCopies
pagination
<var name="duplex" />
setPagination
staple
<var name="staple" />
setStaple
jog
<var name="jog" />
setOutputJog

A sequence can use var elements to reference named sequences that are defined earlier in the XDC file or defined by the PDL. The following example uses the pageWidth and pageHeight variables:

<var name="pageWidth"/> <var name="pageHeight"/>

A sequence can also reference other sequences by name. Such references are expressed as an XML segment that defines a seq element. The following example is of a startDoc sequence from ps_plain.xdc:

<seq use="#pa_preamble" />&#xa;<seq use="#textEncodings" />

The above sequence references two other sequences (pa_preamble and textEncodings), which are defined elsewhere in the XDC file. XDC Editor does not enable modifications of these sequences or any other sequences that are not visible in the Sequences tab.

For more examples of sequences, see the XDC files provided with your installation.

Encoding PCL sequences

PDL commands that are entered for a sequence must conform to XML conventions. As a result, you must use the <ESC/> element and XML escape sequences to represent characters that have special meaning in XML. The following table shows the more common escape sequences.

Character

Escape sequence

Escape

<ESC/>

Ampersand (&)

&amp;

Left angle-bracket (<)

&lt;

Right angle-bracket (>)

&gt;

Line feed

&#10; 
&#xA;

Carriage return

&#xD;

The following example is of a preDoc sequence for a PCL printer. Before this sequence is included in the PCL stream that is sent to the printer, the escape sequences are replaced by the characters they represent. The escape characters in this sequence appear in bold:

<ESC/>%-12345X@PJL RDYMSG DISPLAY=""&#13;&#10;@PJL ENTER LANGUAGE = PCL&#13;&#10;<ESC/>&amp;l1T<ESC/>*t600R<ESC/>&amp;u600D<ESC/>&amp;l1X

For more information about escape characters for XML, see the XML Specification at www.w3c.org.

Modifying sequences

XDC Editor lets you modify the PDL commands that are associated with predefined sequence names.

  1. At the bottom of the XDC Editor panel, click the Sequences tab.

  2. Select the sequence to modify.

  3. In the Sequence panel, modify the PDL statements as required. Use escape sequences to replace characters that cannot appear in XML documents. For information about escape sequences, see Encoding PCL sequences. For information about PDL sequences, see the corresponding reference documentation.

  4. Click Apply.

// Ethnio survey code removed