# Host Printing: Printers, Email and PDF | WND Software Docs

Source: https://wndsoftware.com/docs/printing

### Host printing

Every report, statement or check run the host prints arrives as a print job. IT decides where each one goes.

WND Terminal is a 3287 printer for the mainframe and a 5250 printer for IBM i. With PrintRoutes , each job goes to a printer, a PDF or text file in a folder, or an email, by its job name, form, user, printer or the words on its first page. PrintTemplate  sets the paper, margins, headers and footers. Jobs no route sends stay in the Printers panel.

The mainframe prints to WND Terminal as it would to a 3287 printer, and IBM i as it would to a 5250 printer. Start a printer from Printers  (or have IT start it with the Printers  policy setting), and every report, statement or check run the host sends arrives as a print job.

With no further setup, each job is saved as a text file in Documents/WND Terminal printouts and listed in the Printers panel, where the person prints it, opens it or downloads it as a PDF. With print routes, IT decides where each job goes instead: a printer, a PDF in a folder, or an email. The person doesn’t have to be there.


```text
form=CHECKS                  -> printer Finance-HP
job=PAY*                     -> folder \\fileserver\Payroll\{job}-{date}.pdf
printer=PRTSTMT              -> email statements@bank.example subject="Statements {date}"
text="GENERAL LEDGER"        -> folder C:\Reports\GL\{date}\
                             -> prompt
```


### Print routes

PrintRoutes  is a list, one rule per line. A rule is what to match, an arrow, and where to send matching jobs. The first rule that matches a job decides where it goes. A job that no rule matches is kept in the Printers panel, as if there were no routes.

What a rule can match, with `*` for any characters and `?` for one (letter case doesn’t matter):

On a small screen, swipe the table to read all columns.


| Match | Compares |
| --- | --- |
| `job=` | The job’s name (see below). |
| `form=` | The form’s name. `form=` with nothing after it matches jobs with no form. |
| `user=` | The person: the computer login, or the person signed in to the gateway. |
| `printer=` | The printer session’s name, or its LU (3287) or device name (IBM i). |
| `text=` | Words anywhere on the first page, such as `text="GENERAL LEDGER"`. |

A rule with several of these needs all of them. A rule with none (or `*`) matches every job. Put values with spaces in double quotes.

Where the jobs go:

On a small screen, swipe the table to read all columns.


| Destination | What happens |
| --- | --- |
| `printer` | The computer’s default printer. |
| `printer NAME` | That printer, by the name the computer knows it by. |
| `folder PATH` | A file. A path ending in `.pdf` or `.txt` is the file’s name, and that picks the format. Any other path is a folder, and the file in it is named `{job}-{date}-{time}.pdf`. |
| `email ADDRESS` | An email with the job attached as a PDF, through the mail server in PrintSmtpServer . Several addresses go with commas. Add `subject="..."` for the subject and `as=txt` to attach text. |
| `prompt` | Kept in the Printers panel for the person to print. |

File names and subjects can use `{job}`, `{form}`, `{user}`, `{printer}`, `{device}`, `{date}` (2026-10-17) and `{time}` (143005 in a file name, 14:30 in a subject). Folders in the path are made when they don’t exist, so `\\fileserver\Payroll\{date}\{job}.pdf` makes a folder a day. Values from the job are made safe for file names first, so a job can never write outside the folder its route names.

A file is written under a temporary name and renamed when it’s complete, so a program watching the folder never picks up half a file. A file that’s already there is kept and the new one gets " (2)". A folder that OneDrive or SharePoint syncs is a good destination. The PDF reaches SharePoint with no more setup.


#### Job and form names

3287 and IBM i printer sessions don’t send a job name or form name with the data, so WND Terminal reads them from the job’s first page, where JES separator pages, JCL listings, IBM i separator pages and most report headings print them:

- The job name, from `JOB NAME: PAYROLL`, `JOBNAME PAYROLL`, `JOB=PAYROLL`, IBM i’s `Job name . . . . : PAYROLL`, or a JCL job card `//PAYROLL JOB (ACCT),...`
- The form, from `FORM: CHECKS`, `FORMS=CHECKS`, IBM i’s `Form type . . . : CHECKS`

When the first page says neither, the job is named after the printer’s LU or device name and the form is empty. Shops that give each kind of output its own printer LU or IBM i device usually route with `printer=`, which always works.


### Page layout

PrintTemplate  says how jobs look as PDF files: settings separated by `|`.

On a small screen, swipe the table to read all columns.


| Setting | Example | Without it |
| --- | --- | --- |
| `paper` | `paper=a4` | Letter |
| `orientation` | `orientation=landscape` | Landscape for jobs wider than 100 columns, portrait for the rest |
| `margin` | `margin=12mm`, `margin=0.5in`, `margin=36` (points) | Half an inch |
| `size` | `size=9` (points) | The largest size up to 10 points at which the job’s lines fit across the page |
| `header` | `header={job} for {user}` | None |
| `footer` | `footer=Page {page} of {pages}` | None |

Headers and footers can use the placeholders above and `{page}` and `{pages}`.

Each job is printed in Courier, one host line to a line of the page, each page of the job on a new page. The page width follows the host: Set Horizontal Format for SCS jobs, the line length of a 3270 print, or the widest line, at least 80 columns. A host that sets the page length (Set Vertical Format) gets that many lines on each page, closed up if need be. A line longer than the page is wide carries on to the next line and is never cut off, and a job page with more lines than fit carries on to another page.

Text files are the lines as the host sent them, in UTF-8, each ending in CR LF, with a form feed between pages.


### Printers

On Mac and Linux, jobs go to the printer through CUPS (`lp`, or `lp -d NAME`) as PDF files, with the page layout above. When IBM i sends the printer’s own language (host print transform, such as `*HP4`), that goes to the printer as it is. On Windows, the job’s text goes to the printer through PowerShell’s `Out-Printer`.


### Email

PrintSmtpServer  is the mail server, as one line, such as `smtp.bank.example:587|from=wnd-print@bank.example`. WND Terminal encrypts with STARTTLS before it sends anything (or uses TLS from the start on port 465), and sends nothing when the server doesn’t offer it. Add `|nostarttls` only for a relay on a network you trust.

No password goes in the policy. Set the mail server to relay for the computers (or the gateway) that print, by their address, as most Exchange and Postfix relays already do for scanners and copiers.

The email says which job it is, from which printer, how many pages, who printed it and when, with the job attached.


### In the Printers panel

Each job shows what became of it: where it was saved or sent, still on its way, or why it couldn’t be sent. Where print jobs go  lists the routes as IT wrote them, and any line that couldn’t be read, with why.

- Show  and Print  work as before. Print opens the system’s print dialog.
- Download PDF  saves the job as a PDF with the organization’s page layout, in Downloads (or as a browser download from the gateway).
- Send again  sends a job where its route says, with the routes as they are now. Try again  does the same for one that couldn’t be sent.

A job its route couldn’t take (a printer that’s off, a share that can’t be reached, a mail server that said no) is saved as text and kept in the panel, so nothing is lost.


### WND Terminal in a browser (the gateway)

Routes run on the gateway. Folders are the gateway server’s (a share the gateway’s service account can write to), email goes through PrintSmtpServer  from the gateway, and `printer` routes print to printers set up on the gateway server. `{user}` is the person signed in. Jobs a route doesn’t send anywhere stay in the Printers panel, where the person prints them from the browser or downloads them as PDFs.


### Audit log

Every job is in the audit log twice. `printer.job` is written when it arrives (pages, size), and `print.job` when it was sent (or `print.failed` when it couldn’t be), with the job’s name, form, pages and destination (`printer`, `folder`, `email`, `prompt`), and for a sent job where it went. Send again  adds `reprint`, and Download PDF  is a `print.job` with the destination `download`. The job’s contents are never in the log.


### Related

[IBM i (5250) Printers, sign-on and IBM’s graphical windows. Read →](https://wndsoftware.com/ibm-i)
[WND Terminal in a browser Routes run on the gateway there. Read →](https://wndsoftware.com/browser)
[Audit log to Splunk and Sentinel Every print job is in the audit log. Read →](https://wndsoftware.com/docs/audit-log-splunk-sentinel)

### Questions


#### Do 3287 print jobs carry a job name?

No. WND Terminal reads the job and form names from the first page, where JES separator pages, JCL listings, IBM i separator pages and most report headings print them. Routing by printer LU or device name always works.


#### What happens if a route can’t deliver a job?

The job is saved as text and kept in the Printers panel with the reason, so nothing is lost. Try again sends it where its route says.


#### Does email need a password in the policy?

No. Set the mail server to relay for the computers or the gateway that print. WND Terminal uses STARTTLS and sends nothing when the server doesn’t offer it.

Technical reviewer: [Albert Joseph](https://wndsoftware.com/authors/albert-joseph), WND Software.
