Klicke hier für den deutschen Artikel.
Introduction
When specifying default filenames when printing to PDF printers or other virtual printers, there are two scenarios to consider.
-
When using the List & Label export functions (e.g., PDF export), the file name and save location can be fully controlled.
-
During a normal print job via the Windows print dialog to virtual printers such as
- Microsoft Print to PDF
- Adobe PDF
- OneNote
- Microsoft XPS Document Writer
- PDF-XChange
- other PDF printer drivers
List & Label cannot reliably influence the suggested file name. The cause lies not in List & Label itself, but in the respective printer drivers and the limitations of the Windows printing interfaces.
FAQ
Below are some frequently asked questions on this topic.
Can List & Label specify a default filename when printing to a PDF printer?
No, at least not in a reliable and vendor-neutral way.
During the normal printing process, List & Label communicates with the printer driver exclusively through the standardized Windows printing interfaces. These interfaces do not provide a universal way to control the filename of a virtual printer.
Each printer driver decides for itself whether and how a suggested filename is processed.
Why does filename specification work for PDF export but not for “Print to PDF”?
These are two different technologies.
PDF export
- Uses List & Label’s internal export engine—completely independent of a virtual PDF printer driver.
- The filename and save location can be controlled directly via export options.
- The behavior is documented and fully supported.
- The result is consistent across all systems.
Print to PDF
-
Uses the List & Label print function with an external printer driver—the internal PDF export is not used or taken into account.
-
The filename logic is determined entirely by the respective driver.
-
Behavior varies depending on the manufacturer, driver version, and Windows version.
Therefore, List & Label can reliably control filenames for its own direct PDF exports, but not when printing via other virtual PDF printers.
What printing options does List & Label offer?
There are several options, each with limitations.
LL_PRNOPTSTR_PRINTDST_FILENAME
This option applies exclusively to Print-to-File (PRN) scenarios.
It is not intended to influence file names from PDF printers such as Microsoft Print to PDF, Adobe PDF, OneNote, or similar virtual printers.
Print Job Title
Some printer drivers use the print job title as a suggestion for the file name.
For example, PDF-XChange Lite can use the title passed via the native API in LlPrintWithBoxStart(…) as the default file name.
In .NET, the title is passed using the DefinePrintOptions event and LlPrintOptionString.PrintJobname.
However, this behavior is entirely driver-dependent and cannot be guaranteed. Many other printer drivers completely ignore this information.
Why doesn’t List & Label specifically support known PDF printers?
There is no general standard for file name control in virtual printers.
Each manufacturer uses its own mechanisms. In some cases, these even differ between different versions of the same printer driver.
Implementing specific workarounds for individual drivers would lead to inconsistent behavior and ongoing maintenance efforts.
What about Microsoft Print to PDF?
Windows provides printer drivers with information such as the document name (lpszDocName).
Some virtual printers can use this information as a suggestion for the file name. However, there are several limitations:
- There is no guarantee that a driver will use this information at all.
- Behavior varies depending on the driver and Windows version.
- Some drivers save the file immediately as soon as a filename is specified.
- In this case, the “Save As” dialog may no longer appear.
- The application often does not receive information about the actual save location.
- The application often cannot determine whether the user has canceled the operation.
Since this behavior is neither consistent nor predictable, List & Label does not use these mechanisms for general filename control.
Can List & Label pre-fill the filename for OneNote?
No. We are not aware of any supported interface that allows applications to pre-fill the filename for OneNote print jobs.
None of the available List & Label options can influence OneNote’s filename behavior.
Can List & Label determine the actual file name or save location?
Generally, no. When a virtual printer displays its own “Save As” dialog, it is managed entirely by the printer driver.
The driver typically does not provide a standardized way to return the following information to the application afterward:
- the final file name
- the selected save location
- whether the save operation was canceled
What alternative is recommended?
For…
- meaningful default file names
- control over the save location
- consistent behavior across all systems
- knowledge of the file that was actually created
…you should use List & Label’s built-in export feature instead of a virtual PDF printer.
Technical background
The Windows printing architecture was originally developed for physical printers. File names played no role in this context. As a result, there is still no general Windows API that would allow applications to control file names for virtual printer drivers in a standardized way.
Virtual PDF printers each implement this functionality on their own. Some use the document title as a suggestion, while others ignore it. Some display a save dialog, while others save directly.
Since no common standard exists, List & Label cannot offer a reliable, cross-driver solution for specifying filenames in the normal printing workflow.