The built in watermark text does not support Unicode text. In this example you will see how you can easily create a Japanese watermark text and use it when printing from Notepad. Of course you can also use technique for other languages and when printing from other applications.
First you open a program such as Microsoft Word to produce the watermark with the Unicode text. In Word there is a watermark feature that helps you create diagonal text on your document background. We can use that in this example.
The Printed Watermark dialog will appear and you can set the watermark properties as you please.
With the watermark in place you have an empty page with at diagonal text. The next step is to export this Word document to a PDF. You can use the built in export functionality in Word or print it to the PDF printer.
Now that we have the watermark PDF, we can start using it. In this example we have a simple Notepad document that we want to print with the watermark.
When you print this document to the PDF printer, you must click the Merge tab to specify the watermark PDF file as the background.
That’s it. You are done. The result will look like this.
A runonce configuration is only meant for one print job. When the printer sees a runonce configuration it will read it and delete it, so that it does not affect the next job.
Printing is an asynchronous process where a program places a print job on the print job queue. Job on the print queue is handled by the Windows Spooler process and sent to the individual printers. Therefore, a program cannot know when a specific print job is up for printing. It can send it to the queue but then it is up to the Spooler.
When printing multiple jobs without any pause between the jobs, you risk overriding a previous runonce.ini before it has been picked up by the corresponding print job. There are basically two strategies you can use to avoid this problem.
The first is to wait for your print job to finish before sending the next one. Let’s say that you are a programmer and want to print multiple PDF documents in a loop. In this case it is recommended that you use the statusfile setting to specify a unique status file name for each job. After you have written the runonce configuration and sent the job to the printer, you wait for the status file to appear. When you see the status file, you can read it and move on to the next job. The benefit of waiting for a status file instead of the actual document is that the status file will also be created in case of an error. The other benefit is that the resulting PDF document is completed when the status file is written. If you simply look for the PDF document then it may not be complete when you first see it in the file system.
The second method require that you can control the name of the print job in the printer queue. This is possible from many programming languages but it may not be possible in other systems. If you can set the print job name then you can create a specific runonce configuration that will only be picked up by that particular print job. More information is available here:
In case you need a high throughput of print jobs, you can install multiple printers with dedicated printer ports. You can read more about Printing to multiple virtual printers simultaneously here:
Terminal Server and Citrix
The runonce configurations are user specific. This means that runonce files from one user does not affect other users on a system with multiple users. This means that it is safe to use on a Terminal Server.
Creating Runonce Files
Given that the runonce is a simple text file, you can use any programming technique for writing text files to create a configuration. The location and character encoding are documented here:
Instead of writing the configuration files directly, it is recommended that you use the API to do that. The API will know the correct location for the current users on the specific version of Windows. The API is available in both COM and Microsoft.NET versions.
This is a link to an example of how to use the runonce from code:
How do you set up the default save location for your PDF documents? This is a common question we get from the users of the PDF printer.
The answer is simple and the possibilities are endless if you want to do advanced stuff.
First the simple answer
You simply open the Options dialog from the Start menu. In there you change the File Name setting to your preferred location and file name.
When you specify the output path, you can use something called Macro Tags to make the file name a bit more flexible. These tags are substituted with dynamic values that may depend on the current date and time or settings on your specific machine. It can also get information from the print job or even run a script.
The most used tags include <desktop>, which points to the location of the desktop, or <personal>, which is your personal documents folder on the machine.
This is what it looks like:
Now, the advanced answer
The macro tags can tap into information such as environment variables, system time, print job information, counters, unique id generation, and running scripts.
If you want the printer to generate file names automatically and have a counter or unique id as part of your file name, this will show you how.
When you open the printer options from the start menu, you can set a file name to use when a print job is created. This file name can contain tags, which are substituted with other values when printing.
Tags can give you information such as timestamps, user names, machine names, and much more. A couple of these tags have functionality for counters and unique id generators.
Here is an example where a counter is used.
Every time the printer is used the <counter> tag will increase by one.
We have been asked by system administrators if it is possible to print to many PDF printers at the same time. It is now. Starting with version 11.14, you can create multiple printer ports during installation. Before this version, the limiting factor was that even if you had multiple virtual printers, they would all use the same virtual printer port. This means that one printer had to wait for the other to finish spooling the print job.
When you install a new PDF printer with a custom name using /PRINTERNAME=”My printer”, you can now add a custom port for this printer. The port is added with /PORT=”MYPORT”. This will give you a printer named My Printer connected to MYPORT. This means that the new printer can spool and print individually from other printers on the same machine.
Example of running the setup to add the new printer:
Another optimization of the printing speed is to change the spooler options to Start printing after last page is spooled. This helps if one print job is taking a long time to finish printing. Usually, the spooling is faster than the printing for the virtual printer.
One caveat of this option is that if you use the runonce.ini
to control the parameters of the print job, you no longer know the order of the
print jobs. This means that unless you have unique names for your print jobs
the runonce.ini files may not be used with the print jobs they were meant for.
If you can control the names of the print jobs from the
printing application, then you can use the runonce_jobname.ini file
names to match the print jobs and the configurations.
Fast PDF Printing
The fastest printing is achieved by creating a configuration for the printers that generate automatic file names and disable the printing dialogs so that printing is unattended. On top of that, you should create multiple instances of the printer with different names and individual port names. Spooler settings should be set to start printing after the last page is spooled.
Please send us an email if you have feedback for this
Sometimes you get unexpected results when you use a PDF document as a background.
A PDF used as a background in a merge or superimpose operation is often referred to as the letterhead, watermark, logo, or briefpapier (in German). These documents can have properties that make them unsuited for this purpose. Among the common problems are font, color model, and transparency issues.
The result of using a problematic PDF is often strange colors or strange-looking text.
Normally, you can clean the PDF by printing it to a new PDF. This process can rewrite the structure of the document so that it can be used in the merge or superimpose operation.
A method that often works is to open the PDF in Adobe Reader and print it to a Bullzip PDF Printer installed in XPS mode. The method is not bulletproof but is often a good first try.
Text that looked strange before will most likely be fixed. However, you may not be able to select and copy/paste it as text anymore. Also, colors are now likely to be close to the original but there may still be small differences.
You can play around with this process to see if you can get a better result. Here are some parameters that you can test with different values.
It is often a combination of printing the PDF from a specific PDF viewer to a specific PDF printer that will remove the commands that are causing the problem.
Here are some PDF viewers to try:
Bullzip PDF Studio
Adobe PDF Reader
Sumatra PDF Reader
Combine that with printing to one of these PDF printers:
Bullzip PDF Printer
Bullzip PDF Printer in XPS mode
Microsoft Print to PDF
If you cannot fix the PDF yourself, then it may be an option to go back to the designer and have them try to create a PDF without transparency and special font information. It may be that they can change some settings in the PDF export that will fix the problem.
The PDF printer was originally based on converting the output from Postscript drivers to PDF. This way of doing it has served the purpose well for a long time. However, sometimes the output can convert in ways that do not serve the end purpose well.
Especially font issues have been a reason to look for alternatives to the Postscript driver technology. Postscript has built-in fonts and different strategies for embedding subsets of fonts which may not work well with software that tries to read or copy/paste the content of PDF documents.
To fix some of the Postscript related issues we have added the option to use an XPS based driver. The functionality of the XPS based approach supports fewer features but it solves some of the other issues.
You can tell the installer to add a PDF printer based on an XPS driver by adding the /XPS switch to the command line of the setup program.
The following command line is an example that shows how to add an extra PDF printer named “PDF Printer (XPS)” to your system.