An example workflow is for the user to print a customer receipt to a physical printer and the system will also create an archive by printing the same content to a PDF file using a PDF output printer driver.
In this example:
The printHtmlEx() API is used to print content that has been assembled at the client to the printer you select and a copy will then also be printed to a file using the "Microsoft Print to PDF" driver.
This document is printed using the Print() API and once printed, a copy is then also printed to a file using the "Microsoft Print to PDF" driver.
A moment while things get organised ....
ScriptX will not overwrite an existing file, so this file must not exist. If it does, you must delete it first.
A production system system would probably output to a file share with a unique name generated by the application server. The application
server will process the file after printing by, for example, archiving the file in a central repository.