Overview
Section titled “Overview”The Print action prints one or more files on a printer installed on this PC – for example, every incoming invoice on paper as well. No window opens; printing runs without asking.
| File type | Extensions |
|---|---|
.pdf |
|
| Images | .png, .jpg, .jpeg, .bmp, .gif, .tif, .tiff (multi-page TIFF files page by page) |
| Text | .txt, .log, .csv, .xml, .json (Consolas 9 pt, half-inch margin unless margins are set, lines that are too long are cut off) |
PDF pages and images are shrunk to the printable area of the paper (or the area inside the margins you set) when they are larger, but never enlarged, and centered. Without a fixed orientation (Landscape), every page is turned the way it is laid out: landscape pages print landscape, portrait pages portrait.
Errors: before the first page, RUNOS checks the printer, all files, the file types and the options. If any of them is invalid, the action fails without printing anything. The files are then printed one after the other. If one fails, the rest are not printed (Skipped) and the action fails. As with any action, the run then ends or the workflow’s error handling takes over.
In the workflow editor you put the action together in a form and try it with Test step.
The opposite direction, from a program’s printout into a folder, is described under PDF printer.
Structure
Section titled “Structure”{ "Type": "Print", "Name": "PrintFile", "Parameters": { "Source": "{{FilePath}}", "Printer": "default", "Copies": 1, "Duplex": "LongEdge" }}| Parameter | Default | Meaning |
|---|---|---|
Source |
– | The file(s) to print: a path, several separated by ; or line breaks, a list, or a pattern like C:\Out\*.pdf. Files are printed in this order; the matches of a pattern alphabetically. |
MissingFiles |
Error |
Error: if a file is missing or a pattern finds nothing, the action fails. Skip: keep printing without it, with a warning. If all are missing, the action prints nothing and succeeds with warnings. |
Printer |
default |
default = the Windows default printer, otherwise the name of an installed printer as shown under Settings → Printers & scanners (case does not matter). If the printer is not installed, the action fails; the error message lists the installed printers. |
Copies |
1 |
Number of copies of each file (collated). If the printer driver cannot make that many copies, the file is printed that many times. |
Duplex |
default |
Simplex (one side), LongEdge (both sides, bound on the long edge) or ShortEdge (on the short edge). If the printer cannot print on both sides, it prints on one side, with a warning. |
FromPage, ToPage |
default |
First and last page (from 1), for every file; for text files the printed pages count. A ToPage past the last page prints to the end; a FromPage past the last page is an error. |
Color |
default |
true = color, false = black and white. If the printer does not print in color, there is a warning. |
Landscape |
default |
true = landscape, false = portrait. default: PDF pages and images by their own orientation, text as set in the printer. |
PaperSize |
default |
Paper size as the printer names it, e.g. A4 or Letter. |
PaperSource |
default |
Paper tray as the printer names it, e.g. Tray 2. |
Resolution |
default |
High, Medium, Low, Draft or dpi like 600 or 600x600. |
MarginTop, MarginBottom, MarginLeft, MarginRight |
default |
Margin in millimetres from the paper edge, e.g. 15 or 12.5. The content is fitted into the area inside the margins. A margin smaller than the printer’s unprintable edge counts as that edge. default: the printer’s edge, plus half an inch for text files. If the margins leave less than half an inch, the action fails. |
default (or an empty value) leaves the printer’s setting unchanged. If the printer does not know a given paper size, tray or resolution, the action fails; the error message lists the available values. All values may contain placeholders, including numbers and yes/no values ("true", "yes", "1").
Result
Section titled “Result”"Response": { "Results": [ { "Source": "C:\\RUNOS\\Out\\INV-1001.pdf", "Printer": "Brother HL-L2350DW", "Status": "Printed", "Pages": 2, "Copies": 1, "Message": "Sent to the print queue of 'Brother HL-L2350DW'." } ], "SuccessCount": 1, "ErrorCount": 0}Status is Printed, Error (the file it failed on) or Skipped (not printed after an error). Pages counts the pages of one copy. If the check before printing already fails (printer, file, option), Results is empty and ErrorCount is 1; the message is in Status.Errors. Warnings (no duplex, no color, skipped files) are in Status.Warnings.
Form in the editor
Section titled “Form in the editor”In the diagram of the workflow editor the action has a form (in the settings panel and in the middle column of the test view):
- What is printed: Files and what happens with missing files (error or skip).
- Printer: the installed printers, the default printer first, unreachable ones marked offline; the button next to it reads them again. Plus Copies, Two-sided, From page / To page, Color and Orientation.
- Paper, tray and margins: Paper size, Tray and Resolution with suggestions from the chosen printer, and the margins Top, Bottom, Left and Right in mm (empty = default).
Every field also takes {{…}} placeholders and values you drag in from the Input column of the test view; lists, switches and number fields become a text field when given a {{…}}. Parameters the form does not know are kept under Other parameters. Test step runs the action once, right away, with the data of the earlier steps, and shows the result with errors and warnings. The test really prints.
Example
Section titled “Example”Print every invoice that arrives in the folder C:\RUNOS\Invoices twice, double-sided, on the printer “Accounting”:
{ "Name": "Print invoices", "Autostart": true, "Trigger": { "Type": "File", "Name": "Invoices", "Parameters": { "Pool": "C:\\RUNOS\\Invoices", "Filter": "*.pdf" } }, "Actions": [ { "Type": "Print", "Name": "PrintInvoice", "Parameters": { "Source": "{{FilePath}}", "Printer": "Accounting", "Copies": 2, "Duplex": "LongEdge", "PaperSize": "A4" } } ]}Several files at once, e.g. a cover sheet and all PDFs:
"Source": "C:\\RUNOS\\CoverSheet.pdf; C:\\RUNOS\\Out\\*.pdf"