Home / How to / How to Automatically Add the Source File’s Filename to Your Printouts

How to Automatically Add the Source File’s Filename to Your Printouts

Hi, can 2Printer add the filename to the printout, similar to how it adds text via watermarks? I'd also like to add "_printed" to the end of the filename when moving the original file using the post-processing operation (-postproc switch).

— request from a customer

Adding a filename to the printout automatically

To add the original file's name to your printout, use this sample command:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"{SrcFileName}.{SrcFileExt}"

Your printed pages will then show the original file's name in the top left corner:

Adding file's filename to the printout automatically

If you want to adjust the watermark position, you can use the halign, valign, offx, and offy parameters. Learn more

Note: You can also set this watermark as the default. Use the Text watermark operation in 2Printer Settings following these steps:

  1. Run command 2Printer.exe -ini 
  2. Switch to the Watermarks tab
  3. Add newText watermark
  4. Enter {SrcFileName}.{SrcFileExt} in the text field
  5. (Optional) adjust the watermark position using the options below
  6. Save the watermark by clicking OK
  7. Print your files using a basic 2Printer command (e.g., 2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet")
2Printer default settings: Adding file's filename to the printout automatically

Adding a filename to the printout and "_printed" suffix when moving files to "successfully processed" folder

To add the source filename to the printout and append "_printed" when moving the file to a designated folder, use this command:

2Printer -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"{SrcFileName}.{SrcFileExt}" -postproc passed:copy passed_dir:"C:\Out\_src" passed_name:"{*SrcFileName}.{*SrcFileExt}_printed"

As a result, your files will be printed with the source filename added, and the original file will be moved to the C:\Out\_src folder and named as "<filename>.<file extension>_printed".