IMDTouchKnowledge BaseShop main store

Troubleshooting

Why a TIA Portal HMI screen printed to PDF shows a black border

HMI and touchscreens Published 7 min read By IMDTouch engineering team

Short answer

The black border around an HMI screen printed from the TIA Portal project tree is a Windows display-scaling artifact, not a printer, page-layout or screen-setting fault. Set Scale and layout to 100 percent, restart TIA Portal and reprint; the PDF comes out clean. Panel-side printing and XPS image extraction bypass it entirely.

On this page
  1. Why does a TIA Portal HMI screen print to PDF with a black border?
  2. Which Windows setting decides the border?
  3. How do you set the scale and reprint the screen?
  4. Why doesn't changing the page layout remove the border?
  5. What if the workstation must stay above the default scale?
  6. How do you pull a clean image out of an XPS print?
  7. When is the border a different fault?
  8. Questions asked

Print an HMI screen from the TIA Portal project tree and get a PDF wrapped in a thick black frame, and the first instinct is to blame the printer driver or the page layout. Neither is the cause. The frame is drawn by the engineering station's own display scaling: with the Windows desktop set above its default scale, the print pipeline pads the gap between the logical screen rectangle and the paper rectangle with black fill. Change one Windows setting, restart TIA Portal, and the same right-click print to PDF comes out clean. This article names the setting, gives the steps, shows the arithmetic that explains why the frame grows with the desktop, and lists the workarounds for stations that must stay at a higher scale.

Why does a TIA Portal HMI screen print to PDF with a black border? #

The border comes from the engineering station's Windows display scaling being set above 100 percent, not from the printer, the page layout or the screen itself: drop the scale, restart TIA Portal and the same right-click print comes out clean.

The print in question is started from the engineering view: right-click the screen in the project tree, choose Print, pick A4 landscape, and the PDF that returns carries a solid black band on every side of the screen picture. Each of the usual suspects can be ruled out in a minute:

  • Not the printer driver: PDF, XPS and physical output all show the identical frame, so the black fill exists before any driver touches the job
  • Not the page layout: portrait, landscape and other document layouts all reproduce it
  • Not the screen configuration: the screen editor draws the same screen clean on the monitor
  • Not the runtime: this print never starts the panel or the simulator, so no runtime rendering is involved

What remains is the engineering station itself, and specifically the desktop scale that its print pipeline inherits.

Which Windows setting decides the border? #

One setting decides it: Scale and layout under Settings, then System, then Display, where Windows 10 offers 100, 125, 150 and 175 percent — any value above the first produces the frame.

TIA Portal is a Windows desktop application that draws its print output through the GDI print path. When the desktop scale sits above its default, Windows virtualizes the GDI coordinate space at the scaled DPI, and the print composer paints a letterbox fill between the logical screen rectangle and the paper rectangle the document layout requests. The PDF printer simply rasterizes what it receives, frame included. This is why the fault follows the workstation and not the project: print the same screen from a colleague's station set to the unscaled value and the page comes back clean.

How much thicker does the border get as the scale rises? #

The frame grows in direct proportion to the scale: the render canvas is multiplied by the same factor as the desktop, so each step up in scale thickens the black band by that fraction of the page.

Worked example with illustrative layout numbers: take a screen configured at 1280 × 800 pixels. At the 125 percent setting, the print canvas is laid out at 1280 × 1.25 = 1600 by 800 × 1.25 = 1000 device pixels; at 150 percent it is 1280 × 1.5 = 1920 by 800 × 1.5 = 1200. The fixed-size screen bitmap is then mapped onto the paper and the leftover canvas is filled black, so the 150 percent print carries roughly one and a half times the frame thickness of the 125 percent print. These canvas figures illustrate the proportion rather than a measured page dimension, but the relationship — and the cure — is the same on any station.

How do you set the scale and reprint the screen? #

Set Scale and layout to 100 percent, close TIA Portal before you change it and reopen it afterwards, then reprint; the whole detour costs a few minutes and is undone by picking the higher value again.

  1. Save all work in TIA Portal and close it — some Windows builds sign the user out when the scale changes
  2. Open Windows Settings, go to System, then Display
  3. Under Scale and layout, pick the unscaled value and Apply
  4. Reopen TIA Portal and the project
  5. Right-click the screen in the project tree and choose Print
  6. Set the document layout to the orientation you need, for example A4 landscape
  7. Print to Microsoft Print to PDF and check the page: the frame is gone
  8. When the higher scale is needed again, set it back and restart TIA Portal

Why doesn't changing the page layout remove the border? #

The page layout sits downstream of the render: A4 portrait, A4 landscape or any other layout receives a metafile that already contains the black fill, so no paper size or orientation choice can remove it.

The document layout settings decide how the finished metafile is placed on the sheet. The frame is inside the metafile, produced while the screen bitmap was being composed against the scaled canvas, so reorienting the paper or switching layout templates just moves the framed picture around the page. This matches the report that a layout change to A4 landscape, and to other document sizes, left the result unchanged. Fix the input to the spooler — the scale — and every layout prints clean.

What if the workstation must stay above the default scale? #

Two workarounds print clean without touching the desktop scale: print from the panel or runtime, which renders at the panel's native resolution and never passes through the engineering station's scaled canvas, or extract the raw image from an XPS print.

For daily work the high scale can stay: Siemens documents that TIA Portal adapts to monitor scaling up to 350 percent, so the editors themselves are fine at high scale — it is the print path that shows the artifact. Windows also offers a per-application high-DPI override on a shortcut's Compatibility settings; results with TIA Portal differ between releases, so treat it as something to try on your own station rather than a guaranteed fix. For documentation, the runtime side is the reliable route: printing images and PDFs from a Unified Comfort panel follows its own panel-side procedure, covered step by step in the guide on printing images and PDFs from a Unified Comfort Panel. And where the printout only exists to hand the shift a copy of the current screen, read-only shop floor viewers at the machine remove the paper step entirely.

How do you pull a clean image out of an XPS print? #

Print the screen to an XPS file, rename a copy's .xps extension to .zip, and extract the archive: an XPS document is a ZIP container of fixed-page XML, and the raster images inside come out without the frame.

The images embedded in the archive are the bitmaps the print engine generated before page composition added the letterbox fill, so they are the cleanest source you can get from the engineering view. Extract them, drop them into your documentation, and size them on the page yourself. Rename a copy rather than the original so the printable document survives. This workflow is also how the scaling correlation was first confirmed: the embedded bitmaps were clean on the same station whose PDF output was framed, which pointed straight at the desktop scale.

When is the border a different fault? #

If the scale already sits at the default value and the frame survives a restart, the fault is a different one: large fonts on WinCC Professional screens produce a documented black-border artifact of their own.

That fault follows the font size on the screen rather than the desktop, and it has a separate cause and fix, described in the guide to the large-font number border artifact on WinCC Professional HMI screens. Work through the two in order — scale first, because it takes one setting change and one reprint to test; screen fonts second if the frame survives. Between them they cover the black-frame prints this kind of engineering station produces.

Questions asked

Does the border depend on which PDF printer I choose?

No. The identical frame appears through Microsoft Print to PDF, the XPS Document Writer and physical printers, because the black fill is already inside the print metafile TIA Portal produces before any driver sees it. That is why switching drivers or ports never helps, and why the Windows scale setting, which shapes that metafile, is the actual fix.

Which TIA Portal versions are affected?

Field reports begin with version 14 and the same behavior recurs on later releases. The mechanism, not the version, decides: a station whose Windows desktop scale sits above its default produces the frame, and a station at the default scale prints the same project clean. Confirm on your own station with a one-screen print before changing anything else.

Does the fix affect anything else on the workstation?

Only the size of desktop text and icons while the unscaled value is set; project data, settings and files are untouched. Some Windows builds sign the user out when the scale changes, so save and close other applications first. Set your preferred scale back afterwards and restart TIA Portal before printing again.

Why does the XPS renaming trick give a clean image?

An XPS file is a ZIP archive of fixed-page XML plus the images the print engine embedded. Those images are the bitmaps TIA Portal generated before page composition added the black fill, so extracting them returns the screen picture without the frame. Rename a copy of the file rather than the original, so the printable document stays intact.

Keep reading

  • Explainer

    Why TIA Portal HMI screens do not export to jpg directly

    No command in TIA Portal writes composed HMI screens to jpg. Document the screens with repeatable fixed-region captures at one common zoom level; use the Export Graphics Tool only when you need the individual graphics in their original file types, and expect project printing to deliver object tables rather than pictures.

    HMI and touchscreens

  • Troubleshooting

    Why a simulated HMI shows hash marks, not PLC values

    Hash marks mean the simulated panel runtime is not receiving any displayable value, so treat it as a communication problem before anything else. In the Windows Control Panel of the configuration PC, set S7ONLINE (STEP 7) to TCP/IP on the adapter that reaches the S7-1200, or to PLCSIM when the PLC is simulated too. Then confirm each tag's data type, widen any format pattern the value outgrows, and prove the route with a safe write.

    HMI and touchscreens

  • Troubleshooting

    TIA Portal shows no HMI option: install WinCC Engineering

    WinCC Runtime Advanced only executes HMI projects; it cannot create them. TIA Portal shows no HMI device option until the matching WinCC engineering package (Basic, Comfort/Advanced or Professional) for your TIA Portal version is installed and licensed. Reinstalling the runtime does nothing.

    HMI and touchscreens

Why a Dark Mark Stays Fixed on an HMI Screen