Back to Knowledege base

Understanding Form Types, Paper Types, and Suffixes

How Xi-Text uses form types to manage different paper and printing requirements

Understanding Form Types

A form type in Xi-Text represents both:

  1. The paper type - the physical media loaded in the printer
  2. How to print on it - formatting, orientation, processing options

Form types consist of two parts separated by a dot (.) or minus (-):

paper-type.suffix

Examples:

a4.ps          ← Paper: a4, Suffix: ps (PostScript)
letter.land    ← Paper: letter, Suffix: land (landscape)
labels         ← Paper: labels, Suffix: none
letterhead.p12 ← Paper: letterhead, Suffix: p12 (12 pitch)

Paper Type vs Suffix

Paper Type (before the dot/minus) : Physical paper loaded in printer : Requires stopping printer to change : Represents physical intervention needed

Suffix (after the dot/minus) : Software-controlled variations : Changes automatically between jobs : No printer intervention required

Key principle: If someone must physically touch the printer to change it, it's a paper type. If software can handle it, it's a suffix.

Why This Separation Matters

Changing paper type requires:

  1. Halt printer (or halt at end of job)
  2. Physically change paper
  3. Tell Xi-Text about new paper type
  4. Restart printer

Changing suffix requires:

  • Nothing - Xi-Text handles it automatically
  • Sends appropriate escape sequences to printer
  • Processes job through filters as needed

What Suffixes Control

Suffixes can specify:

Orientation : Portrait vs landscape printing

Font selection : Character pitch, font families

Bin selection : Input/output tray selection

Processing : Filters to convert formats (PCL to PostScript)

Formatting : Margins, line spacing, page layout

All provided the printer supports software control of these features.

Setup File Structure

Xi-Text uses setup files to control printer behaviour for each form type.

Location:

/usr/spool/printers/<printer-name>/

Files in this directory:

a4              ← Setup for "a4" paper type
letter          ← Setup for "letter" paper type
default         ← Fallback setup if specific file not found
.device         ← Common device settings (optional)

How Xi-Text Selects Setup Files

For form type a4.ps on printer ptr1:

  1. Extract paper type: a4
  2. Look for /usr/spool/printers/ptr1/a4
  3. If not found, use /usr/spool/printers/ptr1/default
  4. If neither exists → Error, printer won't start

For form type letter.p10 on printer ptr1:

  1. Extract paper type: letter
  2. Look for /usr/spool/printers/ptr1/letter
  3. If not found, use /usr/spool/printers/ptr1/default

For form type labels (no suffix) on printer ptr1:

  1. Paper type: labels
  2. Look for /usr/spool/printers/ptr1/labels
  3. If not found, use /usr/spool/printers/ptr1/default

The .device File

Common settings shared across all form types go in .device:

bash

# /usr/spool/printers/ptr1/.device

# Serial port settings
device=/dev/ttyS0
baud=9600

# Or network settings
network=<printserver:9100>

Best practice: Use .device only for hardware interface settings that don't change with form types.

Creating Form Type Setup Files

Simple Setup (Plain Text Printer)

bash

# /usr/spool/printers/ptr1/default

# Minimal setup - no special commands needed
# Xi-Text will send jobs directly to device

PostScript Printer Setup

bash

# /usr/spool/printers/ptr1/a4

# Setup for A4 PostScript printing
setup="^D@PJL SET PAPER=A4^M"

# Different handling for landscape suffix
sufstart .land="^D@PJL SET ORIENTATION=LANDSCAPE^M"
sufend .land="^D@PJL SET ORIENTATION=PORTRAIT^M"

Form with Multiple Suffixes

bash

# /usr/spool/printers/ptr1/letter

# Base setup for letter paper
setup="^D@PJL SET PAPER=LETTER^M"

# Portrait mode (suffix: .port)
sufstart .port="^D@PJL SET ORIENTATION=PORTRAIT^M"

# Landscape mode (suffix: .land)  
sufstart .land="^D@PJL SET ORIENTATION=LANDSCAPE^M"

# 12 pitch (suffix: .p12)
sufstart .p12="^[[&k2S"

# 10 pitch (suffix: .p10)
sufstart .p10="^[[&k0S"

Jobs with form types letter.port, letter.land, letter.p12, letter.p10 all use this setup file with appropriate suffix handling.

Suffix Events

Xi-Text can execute commands or send strings at various suffix-related events:

sufstart : When suffix first selected (first job with this suffix)

sufend : When suffix deselected (switching to different suffix)

docstart : Start of each job (regardless of suffix)

docend : End of each job

pagestart : Start of each page

pageend : End of each page

Example:

bash

# Letter paper setup with duplex suffix

# Enable duplex for .dup suffix
sufstart .dup="^[[&l1S"

# Disable duplex when switching away from .dup
sufend .dup="^[[&l0S"

# Page eject after each job
docend="^L"

Practical Form Type Examples

Example 1: Basic Office Setup

Paper types:

  • a4 - Plain A4 paper
  • letter - Plain letter paper
  • letterhead - Company letterhead

Suffixes:

  • .ps - PostScript content
  • .land - Landscape orientation
  • .dup - Duplex (double-sided)

Form types in use:

a4              ← Plain A4
a4.ps           ← A4 PostScript
a4.land         ← A4 landscape
a4.dup          ← A4 duplex
letter          ← Plain letter
letterhead      ← Letterhead, portrait
letterhead.land ← Letterhead, landscape

Example 2: Labels and Special Media

Paper types:

  • labels - Address labels
  • envelopes - Envelope feed
  • cardstock - Heavy card stock

Suffixes:

  • .small - Small format
  • .large - Large format

Form types:

labels
labels.small
envelopes
cardstock

Example 3: Production Printing

Paper types:

  • a4 - Standard A4
  • invoice - Pre-printed invoices
  • statement - Pre-printed statements

Suffixes:

  • .p10 - 10 pitch
  • .p12 - 12 pitch
  • .bold - Bold font

Form types:

invoice.p10
invoice.p12
statement.p10
a4.bold

Matching Jobs to Printers

Jobs match printers based on paper type only (suffix ignored for matching):

Example:

bash

# Printers configured:
ptr1: a4
ptr2: letter
ptr3: a4

# Jobs submitted:
Job 1: a4.ps     ← Can print on ptr1 or ptr3
Job 2: a4.land   ← Can print on ptr1 or ptr3
Job 3: letter.ps ← Can print on ptr2 only
Job 4: a4        ← Can print on ptr1 or ptr3

When job selected for printing, suffix determines which commands Xi-Text sends to the printer.

Changing Form Types

Change Printer's Paper Type

Requires halting printer:

bash

# Halt printer
sphalt ptr1

# Physically change paper

# Change form type in Xi-Text
sqchange -f letterhead ptr1

# Start printer
spstart ptr1

Jobs with Different Suffixes

No halt required:

bash

# Printer loaded with: a4
# Jobs in queue:
# - Job 1: a4.ps
# - Job 2: a4.land
# - Job 3: a4.dup

# All three print automatically
# Xi-Text sends appropriate commands for each suffix
# No operator intervention needed

The "standard" Form Type

When Xi-Text first installed, default form type is standard. This is just a placeholder.

Best practice:

Replace standard with your actual default paper type:

bash

# Change default form type for users
spuser -d a4  # Sets a4 as default for new jobs

Or keep using standard:

Create setup file and configure printers with standard:

bash

# Create setup
vi /usr/spool/printers/ptr1/default

# Configure printer
sqchange -f standard ptr1

Both approaches work fine. Using actual paper type names (like a4) is slightly clearer.

Form Type Best Practices

Use descriptive paper type names:

  • Good: a4, letter, invoice, labels
  • Avoid: type1, printer1, special

Keep suffix names short and meaningful:

  • Good: .ps, .land, .dup, .p12
  • Avoid: .postscript, .landscape, .duplex

Standardize across printers:

Same form type should work similarly on all printers:

  • a4.ps should mean PostScript on A4 everywhere
  • letter.land should mean landscape on letter everywhere

Create only needed form types:

Don't create dozens of form type combinations unless actually used.

Document your form types:

Maintain list of available form types and their purposes:

bash

# Create help file
vi /usr/spool/printers/ptr1/-Help

# Contents:
# Available form types for ptr1:
# a4      - Plain A4 paper
# a4.ps   - A4 PostScript
# a4.land - A4 Landscape
# letter  - US Letter paper

This help file displays when users ask for form type information.

Troubleshooting Form Types

Printer won't start - "Setup file not found":

bash

# Check what files exist
ls /usr/spool/printers/ptr1/

# Create missing default file
vi /usr/spool/printers/ptr1/default

Job won't print - "No printer available":

bash

# Check job form type
sqlist <job_number>
# Shows: Form: invoice.ps

# Check printer form types  
splist
# Shows: ptr1 loaded with "a4"

# Either change job or printer form type
sqchange -f a4 <job_number>  # Change job
# OR
sphalt ptr1; sqchange -f invoice ptr1; spstart ptr1  # Change printer

Suffix not working - same output for all suffixes:

Check suffix commands in setup file:

bash

# View setup file
cat /usr/spool/printers/ptr1/a4

# Verify sufstart/sufend commands present
# Test with simple suffix:
sufstart .test="TEST^L"
Diagnosing Why Jobs Won't Print
Understanding job selection and resolving stuck jobs