How-to
Printing images and PDFs from a Unified Comfort Panel
Short answer
A Unified Comfort Panel has no built-in function that prints the runtime screen or a document to a printer. Print through the panel's LibreOffice install: open the PDF directly, or wrap a JPG in a one-line HTML file, then submit with -p or --pt and automate via runLibreoffice.sh. Use the CUPS lp command only after the printer queue prints a known-good file on the panel.
On this page
A Unified Comfort Panel has no built-in function that prints the runtime screen or a file straight to a printer. The route that works is the panel's own LibreOffice installation: a PDF opens and prints there as a document, and a JPG prints after you wrap it in a one-line HTML file LibreOffice can open. Once one manual copy comes out of the printer, automate the same call through the panel's runLibreoffice.sh script. The CUPS lp command is a fallback for handing a file to a printer queue you have already proven on that panel. Qualify every step on the panel itself, because the LibreOffice build on a Unified Comfort panel does not carry the full desktop feature set.
What the runtime does and does not have #
WinCC Unified on a Unified Comfort panel displays the process and talks to the controller. It has no screen-print action that hands the displayed screen to a printer queue, and the report printing described for the PC runtime runs on the PC's own print subsystem, not on the panel.
Treat the job as two steps: first produce the file, a PDF report or an image of what you need on paper, then print that file at the panel. There is no capture-and-print shortcut, so the file comes first in every case. Producing the image file has traps of its own: on the engineering station, TIA Portal screens do not export to JPG directly, for the reasons in why TIA Portal HMI screens do not export to JPG directly. Displaying a PDF at the panel is a separate subject as well — if a StartProgram-driven PDF button does nothing, that fault is covered in why the PDF button does nothing on a Unified Comfort panel.
Choose the print path #
| What you need on paper | Print path | Gate before you rely on it |
|---|---|---|
| An existing PDF | Open it in the panel's LibreOffice and print | One manual copy prints with every required page readable |
| A JPG or PNG image | A one-line HTML wrapper opened in LibreOffice | The image renders complete in LibreOffice before you print |
| A file through the panel's print service | The CUPS lp command | The queue exists on the panel and a known-good file already prints |
| The live runtime screen | Produce an image or PDF file first, then print that file | Mandatory — no direct capture-and-print exists |
For a PDF, skip the wrapper: LibreOffice prints PDFs as documents. For an image, the wrapper is required because LibreOffice opens documents, not bare picture files.
Prepare the panel and the files #
Install the printer on the panel the way the panel documentation describes for USB or network printers, and note the exact queue name the panel registers. If you plan the default-printer route, confirm which queue is the default right now; with more than one printer installed, name the queue explicitly instead.
Copy the PDF to the root directory of a USB stick. For an image, copy the image to that same root directory and create print.html beside it, containing this documented pattern:
<img src="filename.jpg">
The reference is relative, so LibreOffice looks for the image beside print.html. The name, extension and letter case must match the image file exactly. A mismatch renders an empty or broken frame, which is a file problem, not a printer fault.
Print one copy by hand first #
Work in this order. Each step isolates one failure class, and you do not move on until the previous step proves out.
- Install the printer on the panel and confirm the queue name it registered. If you plan the default-printer route, confirm which queue is the default at this moment.
- Put the PDF in the USB stick's root directory, or put the image there and create print.html beside it with the img tag pointing at the image's exact name, extension and case.
- Open print.html, or the PDF, in the panel's LibreOffice and confirm the image, or every required PDF page, renders completely. A broken or empty frame means filename or path trouble; fix that before printing.
- Print one copy from LibreOffice by hand. Do not automate anything until a physical page emerges.
- Check where that page went: a default-printer submission must land on the intended default queue, a named-printer submission on the queue you passed. A page from another printer is a selection error, not a driver error.
- Now automate, through runLibreoffice.sh, with the same options that worked by hand.
- If the document renders but LibreOffice never produces a page, test the CUPS lp route by hand against the verified queue with a known-good document, then move that exact tested command into the workflow.
Automate the print through runLibreoffice.sh #
runLibreoffice.sh is the panel's documented integration point: scripts and HMI system functions start LibreOffice through it and hand it the LibreOffice arguments. As a worked example, take an image named report_page.jpg and a wrapper print.html in the USB root, with a printer queue registered as Line2Laser — both names are examples:
runLibreoffice.sh -p print.html
runLibreoffice.sh --pt Line2Laser print.html
-p submits the document to the panel's default printer; --pt names the target queue. --headless runs LibreOffice without user interaction; --invisible only suppresses the interface and is not the same guarantee. Confirm the arguments your installed panel image accepts before you rely on the call, because the panel build exposes fewer options than a desktop installation. Run the first automated print on a bench panel or inside a maintenance window, not against a producing line.
When rendering works but no page prints #
Split the fault in two. Rendering means LibreOffice displays the document, which proves the file, the reference and the panel build can open it. Spooling means the rendered job reaches the queue and the printer. A clean render with no page points at printer installation, queue state or submission, so check the printer setup on the panel and the CUPS queue before touching the document again.
The lp command is the second submission path: it hands a file to a CUPS queue, for example lp -d Line2Laser report_page.pdf with the example queue name from above. It does not render the HTML wrapper and it adds no screen-capture function to the runtime, so it only prints files that already exist in a format the queue accepts.
The most expensive mistake is qualifying this workflow on a desktop LibreOffice installation. The panel's build is reduced, so test file opening, every command option, queue selection and unattended behavior on the panel image you actually run.
The decision for each case #
To print a PDF from a Unified Comfort Panel, open it in the panel's LibreOffice and print — no wrapper, no runtime function needed. To print an image, build print.html with the img tag, keep both files in the USB root, and open and print the wrapper in LibreOffice. To submit any file through the panel's print service, use lp, but only against a queue that has already printed a known-good document on that panel. To print the live screen, produce the file first, because no built-in capture-and-print exists. In every case the qualification test runs on the panel, never on a desktop installation.
Questions asked
Can the panel print the live runtime screen without creating a file first?
No. The WinCC Unified runtime on a Unified Comfort panel has no capture-and-print function, so a physical printout begins as a file: a PDF, or a JPG wrapped in an HTML file. Whatever produces that file, a report generator or an image export, is a separate step from printing. The printing step itself runs through the panel's LibreOffice installation or a verified CUPS queue.
Does the panel's LibreOffice match a desktop installation?
No. The LibreOffice build on a Unified Comfort panel is reduced compared with a standard desktop installation, so a command sequence that works on an office PC proves nothing about the panel. Test file opening, every command option, queue selection and unattended behavior on the panel image you actually run, and retest the whole sequence after a panel image update.
Which printer does the -p option submit to?
It submits to whatever queue the panel currently has as its default, and that default follows the printer configuration: add or remove a printer and the default can move. With several queues installed, prefer the named-printer option with the exact registered queue name.
Can the automated print run without anyone at the panel?
Headless mode runs LibreOffice without user interaction, while the invisible option only suppresses the interface and carries no such guarantee. Either way, prove one interactive print from the panel's LibreOffice first, because an unattended failure is silent: with no dialog boxes, a queue or file problem simply produces no page.