Printing fails when setting the data format to "Print PDF with external application"

1 users found this article helpful

Symptoms

When setting the data format to "Print PDF with external application" (Connection Properties → PrintingOptionsData Format), printing fails to work as expected.

Cause

The printer name is passed via the command line, and Windows cannot handle printer names that contain spaces in this context.

Detailed Explanation:

When printing, Windows uses the shell command defined in the registry key:
HKEY_CLASSES_ROOT\Application\Shell\printto\command

This key typically executes the following command:

"C:\Program Files\Application\Application.exe" /t "%1" "%2" "%3" "%4"

Here, the printer name is passed as one of the arguments. If the printer name contains spaces, Windows fails to tokenize the command line properly, resulting in errors.

Resolution

Rename the default printer to eliminate spaces in its name.

For example, rename:

"Printer Brand Type 123""Printer_Brand_Type_123"

 

Was this article helpful?

Tell us how we can improve it.