2Printer Command Line Syntax

2Printer is a print workflow automation solution that operates via a command line interface. Whether you use Command Prompt, PowerShell, or a scripting language interpreter, 2Printer functions in the same way.

How to start batch printing quickly

  1. Open the Windows Command Prompt. Start the Run application by pressing Win + R combination on your keyboard, and type in "cmd.exe" and press Enter:

    Run Command Prompt (CMD, command-line interpreter)

    Command Prompt can be used to execute entered commands. You can use another command-line interpreter that's comfortable for you.

  2. Add switches and parameters to the command. In general, the basic syntax is as follows:
    2printer.exe -src "C:\In\*.*" -prn "Xerox 2050"
    • -src stands for a source for files. It can be a path to a folder, to a file, a list (a .txt with file paths), or an URL.
      Type of source Example
      Folder path -src "C:\In\*.*"
      Path to a file -src "C:\In\Document.docx"
      Path to a list of file destinations -src "@C:\Files\list.txt"
      Web address (URL) https://www.website.com
    • *.* stands for any filename – point – any file extension. It should be added after the folder path so that 2Printer can take all files from there. Asterisk (star, *) is a wildcard character which stands for any string of characters (or no characters at all);
    • -prn should be followed by a printer's name. For example: -prn "Xerox 2050".
    • When setting the source folder path (or source file path) and printer's name – don't forget to enclose them in double quotation marks. Example: -src "C:\In\Invoice.docx" -prn "Canon MFP";
    • When using a web address (URL) as a source, you can add user and password if they are required to access the website.
  3. Press Enter to execute the command. All files from the source (-src) will be printed on the selected printer.

Сommand line structure

The basic command line structure consists of switches, parameters, and values. 2Printer command line structure looks like this:

2Printer -<switch1> [param1:value paramN:value] -<switchN> [parameters]

To see a prompt with a list of available features, type in 2Printer.exe and press Enter:

2Printer.exe

Display help information for 2Printer

Switches

Use switches to select the source for files, printer, print options, post-processing, operations, and more. You can enter several parameters (parameter:value) within a single switch, separated by space.

Switch Description
-src Source for files. A source can be:
  1. Folder path where files are located
  2. Path to a single file
  3. Path to a list with file destinations
  4. Web address (URL)
  • When specifying a folder path, add *.* in the end. For example,  -src "C:\Files\*.*"  You can allow printing only certain files, e.g., -src "C:\Files\*.docx" to print DOCX files only.
  • If you have a list of files to print, it should be saved as a TXT file. To set a list of files as a source, use @ before the file path. For example: -src "@C:\Files\list.txt"
  • When entering a URL to be used as a source, use the format below (don't forget to add https://www). If password entry is required to access the website, specify credentials as well – user and password. -src https://www.cmd2printer.com -src https://www.mywebsite.com -options user:myusername password:mypassword

  • You can use multiple sources at once. Enter them after -src one after another within double quotation marks and separated by a space.
-prn Printer name. When entering commands, input printer name within double quotation marks. You can check the exact name of a printer in advance.
-props Print options. Set up print-related options, such as the number of copies, page range, and more.
-options Common options. Define various options, such as scanning subfolders, sorting files, silent printing, and more.
-spops Service page options. Add a cover page which is a blank sheet of paper or a pre-defined cover page template to separate printed files.
-multipps Multiple pages per sheet. Arrange several pages of a multipage document on one paper sheet before printing.
-postproc Post-processing action. Copy, move, or delete files automatically after processing, if necessary. Can apply both to successfully printed and failed files.
-oper Operations. Perform an operation with each file, such as watermarking, resizing, cropping, or rotation.
-about Information about the program. Shows license key and software version.
-cmdlines Command line. Allows you to run the 2Printer command from a TXT file.
Example: 2Printer.exe -cmdlines "C:\Scripts\2Printer command.txt"

Command line examples:

2printer.exe -src "C:\In\*.*" -prn "Xerox 2050"

2printer.exe -src "C:\In\File.docx" -prn "Xerox 2050"

2printer.exe -src "C:\In\*.*" -prn "Xerox 2050" -props copies:5 color:grayscale

2printer.exe -src "@C:\Files\list.txt" -prn "Xerox 2050" -options silent:yes -props spjob:yes

2printer.exe -src "C:\In\*.*" -prn "Xerox 2050" -postproc passed:move passed_dir:"C:\Done"

2printer.exe -about

Print options (-props)

You can control various print-related parameters using the -props switch.

copies: Set the number of document copies

Default value: 1 Example:

2printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props copies:3

duplex: Set duplex mode (double-sided printing)

Values:
default (default value), simplex, vertical, horizontal

Double-sided (duplex) printing allows you to print on both sides of paper sheets. If your printer supports duplex printing – this might be a useful feature. By default, 2Printer uses the same duplex mode settings as those defined in your printer preferences. In 2Printer, you can set up vertical or horizontal duplex printing for your documents.

Parameter and value Effect
duplex:vertical Prints documents double-sided using long-edge binding mode.
duplex:horizontal Prints documents double-sided using short-edge binding mode.

You can switch to simplex mode (one-sided printing) by using the duplex:simplex value. Or set duplex:default – to use printer preferences.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props duplex:vertical

color: Select color or grayscale mode

Values:
asinprinter (default value), color, grayscale

Prints all documents in grayscale or color mode.

Examples:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props color:grayscale
2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props color:color

orient: Set page orientation

Values:
portrait, landscape, asindocument (default value), asinprinter

The default page orientation value is as set in the document. To print all documents in portrait or landscape orientation, use these commands:

Portrait orientation:

2Printer.exe -src "C:\Input\*.*" -prn "MFP LaserJet" -props orient:portrait

Landscape orientation:

2Printer.exe -src "C:\Input\*.*" -prn "MFP LaserJet" -props orient:landscape

Here you can also select other options:

  • orient:asindocument – use the original document's page orientation;
  • orient:asinprinter – use the same settings for orientation as in printer.

revpo: Select page order

Values:
direct (default value), reverse

Switches to direct or reverse page order. You can change the pages' printing order to reverse when printing multipage documents.

Example:

2printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props revpo:reverse

papersize: Select paper size by ID number

Default value: -1 (as in printer preferences)

Sets a specific paper size format. Paper size value by default is "-1" (as set in your printer preferences). Use this command to check the ID number of a certain paper size:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props papersize:5

pages: Set page range

Default value: all

Defines numbers of pages to be printed.

Example:

2printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props pages:1,3,5-12

scale: Select page scaling mode

Values:
shrink (default value), fit, original, fill, booklet, zoom

Example:

2printer.exe -src "C:\In\Document.pdf" -prn "MFP LaserJet" -props scale:fill
Shrink Shrink-to-page option: decreases page size to printable area. It resizes only large pages to fit the paper and prints small pages in the original size.
Fit Fit-to-page option: fits page size to printable area. Scales small pages up and shrinks large pages down to fit the paper.
Original "Original" option: prints pages or images in their original size.
Fill Fill-to-page option: print a full page from edge to edge on the short side. No matter the size, the page will fill the whole sheet of paper or even beyond the paper (on the long side).
Zoom Set a specific scaling (e.g., 50% or 110%) in relation to the printable area.

zoom_percent: Set zoom level in percents

Default value: 100

Example:

2printer.exe -src "C:\In\Document.pdf" -prn "MFP LaserJet" -props scale:zoom zoom_percent:150

tray: Select printer tray

Default value: as set in printer preferences

Uses a specific printer tray. Enter tray name or ID to use a specific printer tray. You can view a list of available trays in advance.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props tray:4

pssp: Set paper source for selected pages

Default value: none

Sets a certain printer tray for selected pages. That means you can select different paper sources for specific page ranges.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props pssp:"2,5-9=Drawer 1"

attachments: Set the processing of file attachments

Values:
ignore, after (default value), before, only

If you print documents that contain attachments, you can select a way how 2Printer should handle them:

  • ignore – ignore attachments
  • after – print attachment after a document
  • before – print attachment before a document
  • only – print attachments only

This can be useful when batch printing, e.g., correspondence with email attachments, PDF Portfolio files, and other files with attachments.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props attachments:before

spjob: Enable single print job mode

Values:
no (default value), yes

To ensure that files are printed in order, use the Single print job mode. This mode prints the files as a single batch, maintaining the specified order. The files will be sent to the printer from top to bottom as they appear in your list, whether it’s a text file or a list within a folder.

2Printer.exe -src "@C:\Input\docs.txt" -prn "MFP LaserJet" -props spjob:yes

Printing in this mode allows you to print in a strictly defined order. Printouts won't get mixed by spooler or other print jobs coming to the same printer from other users.

spjob_name: Enter a filename for the single print job

Default value: "2Printer's single print job"

You can define the single print job's name:

2Printer.exe -src "@C:\Input\docs.txt" -prn "MFP LaserJet" -props spjob:yes spjob_name:"Docs for visa"

The name appears in the print queue (spooler) on the computer and on the printer display. It may be convenient to see what's being printed. And it's easy to identify which job is having issues in case of an error.

Besides, if you're printing to a virtual printer, the name of the output file(s) usually matches the print job's name.

hor_align: Set horizontal alignment: left, center, right

Values:
left, center (default value), right

Aligns the prints' position in the center, or left/right side of a sheet. Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props hor_align:left

ver_align: Set vertical alignment: top, center, bottom

Values:
top, center (default value), bottom

Aligns the prints' position vertically in the top, center, or bottom of a sheet. Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props ver_align:top

hor_offset: Set horizontal offset

Default value: 0

Shifts the prints' position horizontally by setting a specific value, in points (1/100 inch). Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props hor_offset:150

ver_offset: Set vertical offset

Default value: 0

Shifts the prints' position vertically by setting a specific value, in points (1/100 inch). Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props ver_offset:-50

Command line examples:

2printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -props copies:3 duplex:vertical orient:portrait
2printer.exe -src "@E:\list.txt" -prn "MFP LaserJet" -props spjob:yes spjob_name:"My docs"
2printer.exe -src "C:\In\Document.pdf" -prn "MFP LaserJet" -props tray:"258" pages:"1-3" color:grayscale

ASK US FOR HELP

Common options (-options)

Scanning subfolders, silent printing, printing without alerts, and other options are controlled by the -options switch.

scansf: Scan subfolders

Values:
no (default value), yes

Scans subdirectories and print files from them too (subfolder recursion).

Example:

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -options scansf:yes

srcpwd: Enter source file password(s)

Allows printing of password-protected Word and PDF files. Enter a password in this format: srcpwd:password.

If a password contains spaces, input it between double quotation marks.

Example: srcpwd:"my password".

If you have files secured with more than one password, you can enter multiple passwords too.
Example: srcpwd:password1 srcpwd:password2 srcpwd:password3.

Example:

2printer.exe -src "C:\In\*.*" -prn "iR C3025" -options srcpwd:"my password"

break_on_error: Break on error

Values (value in bold is default):
no (default value), yes

Stops the program in case of an error.

Example:

2printer.exe -src "C:\In\*.*" -prn "iR C3025" -options break_on_error:yes

unprinted_files_log: Create a log of files that failed to print

You can keep a log of files that failed to print for some reason. You'll need to use -options unprinted_files_log and set a path to a file that should be created for the log file. Just specify a destination to a text file.

Example:

2printer.exe -src "C:\In\*.*" -prn "iR C3025" -options unprinted_files_log:"C:\Logs\failed.txt"

sort: Sort files by a specific parameter

Values (value in bold is default):
unsorted, name, date, type, size, path, name_d, date_d, type_d, size_d, path_d

You can sort files by specific parameters, such as name, date, type, size, path. To sort the files in descending order, use values ending with _d (name_d, date_d, etc.).

runscript: Run a script before printing each document

Runs a script (e.g., a BAT file) before printing the next file.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -options runscript:"C:\Data\Clear_printer_buffer.bat"

script_params: Add script parameters

Adds parameters to the script (runscript), such as username or other parameters.

Example:

2Printer -src "C:\In\*.*" -prn "MFP LaserJet" -options -stat report_folder:"C:\Out" -options runscript:"C:\Data\Clear_printer_buffer.bat" script_params:"Username"

showprnlist: Show a list of printers

Displays a list of all available printers and their names. When using other commands, input a printer's name exactly as you see in this list, within double quotation marks.

Execute command:

2Printer.exe -options showprnlist
See full list of available printers

showprnlist2 Show a list of local or network printers

Displays a list of available local or network printers. When using other commands, input a printer's name exactly as you see in this list, within double quotation marks.

Execute command:

2Printer.exe -options showprnlist2

showtraylist: Show a list of printer trays

Displays a list of available printer trays. Can show trays of all devices or a selected printer only. When printing, you can use the ID number or name of a specific tray.

To view all printers' names and trays sublist for each printer:

2Printer.exe -options showtraylist
To view trays of a specific printer only, add the printer's name to the command:
2Printer.exe -prn "iR C3025" -options showtraylist
Show a list of printers and their trays

For instance, here's a command to print on a Multi-purpose Tray of a Canon printer (as on the screenshot above):

2Printer.exe -src "C:\In\*.*" -prn "Canon iR C3000 Series UFR II" -props tray:4

showpapersizelist: Show a list of paper sizes

Displays a list of all available paper sizes. To view paper sizes of a certain printer only, add -prn and the printer's name to the command:

2Printer.exe -prn "Canon iR C3000 Series UFR II" -options showpapersizelist
Show available paper size formats

For example, the following command prints all documents in a folder "C:\In" in Legal paper size format:

2Printer.exe -src "C:\In\*.*" -prn "Canon iR C3000 Series UFR II" -props papersize:5

log: Create events log

Values:
yes (default value), no

Saves log files (in XML format) containing information about the system and records of all 2Printer events. We recommend having this parameter activated because information contained in log files will help 2Printer developers quickly figure out what's happening in case of any error or issue.

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -options log:no

logpath: Set path to log files location

Default value: %TEMP%

Sets path to a folder for log files. By default, it is %TEMP% which usually opens the path "C:\Users\[User]\AppData\Local\Temp".

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -options log:yes logpath:"E:\2Printer Logs"

logverbosity: Set log verbosity

Default value: verbose

Select the type of log created by 2Printer: Verbose, Regular, Laconic, or Trace.

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -options log:yes logpath:"E:\2Printer Logs" logverbosity:regular

silent: Suppress console output

Values (value in bold is default):
no, yes

Prints all documents in fully automatic and silent mode. The information on console window will not be displayed during processing and no dialog windows will appear:

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -options silent:yes

alerts: Display alert windows in case of an error or issue

Values (value in bold is default):
no, yes

Displays alert windows in case of an error or issue. If set to "no", you will not get any dialog windows, such as asking to register the program's license or to print an additional cover page (if the trial version is used). However, the information on console window will be displayed during processing:

2Printer.exe -src "C:\Input\*.*" -prn "iR C3025" -options alerts:no

user: Enter username for printing files from the web

Uses your username (login) if password entry is required to access the web page you want to print (URL is set as a source). Don't forget to specify both credentials – user and password.

2Printer.exe -src https://www.mywebsite.com -prn "MFP LaserJet" -options user:admin password:password

password: Enter password for printing files from the web

Uses your password if password entry is required to access the web page you want to print (URL is set as a source). Don't forget to specify both credentials – user and password.

2Printer.exe -src "C:\Input\*.*" -prn "iR C3025" -options alerts:no

Command line examples:

2printer.exe -src "C:\In\*.*" -prn "iR C3025" -options srcpwd:"my password"
2printer.exe -src "C:\In\*.*" -prn "iR C3025" -options scansf:yes sort:type
2printer.exe -src "C:\In\*.*" -prn "iR C3025" -options silent:yes alerts:no

Service page options (-spops)

The -spops switch allows you to print an additional cover page to easily separate printed documents, e.g., a blank sheet of paper. A cover page can help you easily distinguish between the printouts. You can use a built-in template or your own HTML file as a cover page.

cover: Print cover page

Values:
no (default value), yes

Enables printing cover page between each file. Switch it to yes and specify the type of cover page using the template parameter.

Example:

2Printer.exe -src "C:\Input\*.*" -prn "iR C3025" -spops cover:yes template:"Blank"

template: Select cover page template

Uses a built-in cover page template or a custom cover page in HTML format. To set a custom cover page, add a path to it starting with '@'.

What built-in templates are available? You can find the full list at 2Printer Settings (2Printer.exe -ini) > Common > Service pages > Print cover page. Then type the name of a desired template in the command line. Example: -spops cover:yes template:"Filename with app logo".

Example command for built-in cover page template:

2Printer.exe -src "C:\Input\*.*" -prn "iR C3025" -spops cover:yes template:"Blank"

Example command for custom cover page:

2Printer.exe -src "C:\Input\*.*" -prn "iR C3025" -spops cover:yes template:"@C:\Cover pages\Cover.html"

Multiple pages per sheet options (-multipps)

Print more than one page on a sheet of paper using the -multipps switch. This way, you can fit two or more pages on one sheet of paper.

Please note that Multiple pages per sheet (-multipps) feature works only if your source documents are multipage. If you need to merge several files to a multipage document, we suggest using 2PDF or DocuFreezer. With any of these tools, you can join several files into a single multipage PDF file in advance.

enabled: Enable multiple pages per sheet mode

Values:
no (default value), yes

Prints several pages of a multipage document on a single sheet of paper.

Example:

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -multipps enabled:yes hor_pages:2 ver_pages:2

hor_pages: Horizontal pages on the sheet

Default value: 1

Sets the number of pages to be placed horizontally.

Example:

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -multipps enabled:yes hor_pages:2 ver_pages:2

ver_pages: Vertical pages on the sheet

Default value: 1

Sets the number of pages to be placed vertically.

Example:

2Printer.exe -src "C:\In\*.*" -prn "iR C3025" -multipps enabled:yes hor_pages:2 ver_pages:2

Post-print actions (-postproc)

Use the -postproc switch to control what should be done with the files after processing: do nothing, move, copy, or delete. By default, there is no post-processing action selected for original files; therefore, all your files remain where they were before printing. If you want to move them somewhere, you can do it as you like.

passed: Select action for successfully printed files

Values (value in bold is default):
none, copy, move, delete

Selects action to be performed with successfully printed files: do nothing, copy/move to another folder, or delete.

Move, copy, or delete printed (or not printed) files with post-print action

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -postproc passed:delete

passed_dir: Set path to destination folder for copy/move action

Specifies a folder where successfully printed files should be moved or copied.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -postproc passed:copy passed_dir:"C:\Printed"

passed_delsf: Delete empty unused subfolders

Values:
no (default value), yes

Deletes empty subfolders that are no longer needed after successfully printed files were moved or deleted from there.

To use this feature, make sure to enable scanning subfolders (-options scansf:yes) and set passed_delsf and/or failed_delsf parameters to yes. A "subfolder" here means any nested folder inside the specified source location (for example, C:\In\Subfolder_A in the example below).

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -options scansf:yes -postproc passed:move passed_dir:"C:\Out" passed_delsf:yes

failed: Select action for files that failed to print

Values (value in bold is default):
none, copy, move, delete

Selects action to be performed with files that were not printed: do nothing, copy/move to another folder, or delete.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -postproc failed:delete

failed_dir: Select action for files that failed to print

Values (value in bold is default):
none, copy, move, delete

Specifies a folder where failed files should be moved or copied.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -postproc failed:move failed_dir:"C:\Failed"

failed_delsf: Delete empty subfolders

Values:
no (default value), yes

Deletes empty subfolders after failed files were moved or deleted from there.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -options scansf:yes -postproc passed:move passed_dir:"C:\Out" failed_delsf:yes

Command line example:

2printer.exe -src "C:\In\*.*" -prn "LaserJet 5L" -postproc passed:delete -postproc failed:move failed_dir:"C:\Failed"

File loading settings (-fls)

This switch controls which parameters should be used "on input", meaning it determines which parameters should be loaded when processing certain file types.

-fls html

width: Set page width for HTML files

Default value: 0

Sets custom page width for source HTML files.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -fls html width:500 height:300

height: Set page height for HTML files

Default value: 0

Sets custom page height for source HTML files.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -fls html width:500 height:300

units: Select units for setting width and height

Values:
inch (default value), mm, cm

Switch between inches, millimeters, and centimeters to specify the page size of source HTML files.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -fls html width:500 height:300 units:mm

Statistics (-stat)

The -stat switch creates a report in XML format with printing statistics, such as the types of printed documents and the number of printed pages.

-stat

report_folder: Set path to a folder for saving reports

Sets path to a folder for saving the report (an XML file).

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -stat report_folder:"C:\2Printer reports"

Operations (-oper)

Add the -oper switch to use additional operations on files before printing them. These are: adding an image watermark, adding a text watermark, resizing, cropping, and rotating.

-oper watermark

image: Set path to image watermark

Sets path to the file to be used as a watermark. Example: "C:\Watermark.png"

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png"

halign: Set horizontal alignment for image watermark

Values:
left (default value), center, right

Aligns image watermark horizontally: to the left, center, or right side of a sheet. Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" halign:center

valign: Set vertical alignment for image watermark

Values:
top (default value), center, bottom

Aligns image watermark vertically: to the left, center, or right side of a sheet. Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" halign:center valign:bottom

offx: Set horizontal offset (% of page width)

Default value: 0

Shifts the pages' position horizontally using a specific value (in percent of the page width). Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" offx:20

offy: Set vertical offset (% of page height)

Default value: 0

Shifts the pages' position vertically using a specific value (in percent of the page width). Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" offy:20

size: Set watermark size (% of page width and height)

Default value: -1 (original size)

Sets watermark size as percent of source file's page height and width. For example, enter size:15 for 15%. -1 is the default value, which applies the watermark "as is" using its original size.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" size:15

angle: Set watermark rotation angle

Default value: 0

Rotates the watermark at a specific angle. The rotation is clockwise by default, but you can switch it to counterclockwise.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" angle:45

direction: Select direction for watermark rotation: CW or CCW

Values:
cw (default value), ccw

You can select clockwise (cw) or counterclockwise (ccw) direction for watermark rotation.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" angle:45 direction:ccw

method: Use a certain blending method when watermarking

Values:
alphablend (default value), overdraw

Uses a blending method when applying a watermark – AlphaBlend or Overdraw.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" method:overdraw

zorder: Set Z-order for image watermark application

Values:
foreground (default value), background

Places the watermark behind (background) or in front (foreground) of the document's contents.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper watermark image:"C:\Watermark.png" zorder:background

-oper textwatermark

text: Enter watermark text

You can input any text within double quotation marks.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT"

font: Select font

Default value: Arial

Applies a specific font for text watermark.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" font:Verdana

fontsize: Set font size

Default value: 12

Sets font size value (in points or percents) for text watermark.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" fontsize:20

fs_units: Select font size units: points or percents

Values:
points (default value), percents

Switches between points and percent (percent of image height) when specifying font size.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" fontsize:15 fs_units:percents

bold: Make font bold

Values:
no (default value), yes

Uses a bold font style for the text watermark.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" bold:yes

italic: Make font italic

Values:
no (default value), yes

Uses an italic font style for the text watermark.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" italic:yes

underline: Make font underlined

Values:
no (default value), yes

Uses an underline font style for the text watermark.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" underline:yes

halign: Set horizontal alignment for text watermark

Values:
left (default value), center, right

Aligns text watermark horizontally: to the left, center, or right side of a sheet. Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" halign:center

valign: Set vertical alignment for text watermark

Values:
top (default value), center, right

Aligns text watermark vertically: to the top, center, or bottom of a sheet. Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" valign:center

offx: Set horizontal offset for text watermark

Default value: 0

Shifts the watermark's position horizontally using a specific value (in percent of the page width). Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" offx:20

offy: Set vertical offset for text watermark

Default value: 0

Shifts the watermark's position vertically using a specific value (in percent of the page height). Can be combined with other alignment and offset parameters.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" offy:15

color: Set text color for text watermark

Default value: "r:0,g:0,b:0,a:255"

Applies text color using RGBA color model –
"r:(0-255),g:(0-255),b:(0-255);a:(0-255)".

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" color:"r:0,g:128,b:0,a:255"

bgcolor: Set text background color for text watermark

Default value: "r:255,g:255,b:255,a:255"

Applies color behind the text using RGBA color model –
"r:(0-255),g:(0-255),b:(0-255);a:(0-255)".

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" bgcolor:"r:0,g:128,b:0,a:255"

angle: Set text watermark rotation angle

Default value: 0

Rotates the text watermark at a specific angle. You can select any arbitrary angle.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" angle:45

direction: Select direction of rotation for text watermark: CW or CCW

Values:
cw (default value), ccw

Sets direction for text watermark rotation – clockwise (cw) or counterclockwise (ccw).

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" angle:45 direction:ccw

border: Draw border around text watermark

Values:
no (default value), yes

Adds a border around the text watermark.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" border:yes

zorder: Set Z-order for text watermark application

Values:
foreground (default value), background

Places the watermark behind (background) or in front (foreground) of the document's contents.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper textwatermark text:"DRAFT" zorder:background

-oper resize

pages: Set page range for resize operation

Default value: all

Defines the range of pages which must be resized, e.g., pages:1,3,5-12. If not specified, resizing is applied to every page.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize pages:1,3,5-10 size:"300 300"

size: Set new size of images or pages (width and height)

Default value: "0 0"

Defines width and height dimensions (in pixels) for file resizing. The source file proportions are kept.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize size:"100 100"

units: Select units for setting resize values

Values:
pixels (default value), percents

Uses pixels or percents as units for resize operation.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize size:"50" units:percents

fmode: Select Fit mode

Values:
fit_in_size (default value), thumbnail, fit_width, fit_height, fill_in_size, none

Applies page scaling to fit a specific size. Available values:

  • fit_in_size – Fit the size specified for the size: parameter. Oversized images will be shrunk to the defined width and height, and small ones will be enlarged to fit the page size;
  • thumbnail – Fit the size of a thumbnail;
  • fill_in_size – Fill the size specified for the size: parameter. The image will be positioned on the entire sheet by the smaller side (the longer side may go beyond the defined area);
  • fit_width – Fit the size specified for the size: parameter by width;
  • fit_height – Fit the size specified for the size: parameter by height.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize fmode:fill_in_size

falign: Select Fit alignment

Values:
center (default value), left_top, right_bottom

Aligns the resized image to the center, left top corner, or right bottom corner.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize size:"300 300" fmode:thumbnail falign:right_bottom

nozoom: Disable making image larger than original size

Values:
no (default value), yes

Prevents image upscaling to avoid quality loss.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize size:"300 300" fmode:fill_in_size nozoom:yes

method: Select image resampling method

Values:
bilinear (default value), neighbour

Applies the nearest neighbor or bilinear interpolation resampling method for image resizing.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize size:"300 300" method:neighbour

color: Fill blank margins around the resized image with color

Default value: "r:255,g:255,b:255,a:255"

Fills blank margins around the resized image (if they appear) with a certain color using RGBA color model – "r:(0-255),g:(0-255),b:(0-255);a:(0-255)".

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper resize size:"300 300" color:"r:0,g:128,b:0,a:255"

-oper crop

method: Select method of image cropping

Values:
margins (default value), rect2p, rect_pwh, autocrop

Applies a specific image cropping method.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:rect_pwh

left: Set left margin value

Default value: "0"

Sets the left margin, in pixels. Applies to margins and rect2p crop methods.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:margins left:15

top: Set top margin value

Default value: "0"

Sets the top margin, in pixels. Applies to margins and rect2p crop methods.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:margins top:15

right: Set right margin value

Default value: "0"

Sets the right margin, in pixels. Applies to margins and rect2p crop methods.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:margins right:15

bottom: Set bottom margin value

Default value: "0"

Sets the bottom margin, in pixels. Applies to margins and rect2p crop methods.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:margins bottom:15

width: Set width of cropping rectangle for rect_pwh method

Default value: "0"

Sets the crop width for the rect_pwh crop method, in pixels.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:rect_pwh width:300 height:300

height: Set height of cropping rectangle for rect_pwh method

Default value: "0"

Sets the crop height for rect_pwh cropping method, in pixels.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:rect_pwh width:300 height:300

color: Set color sample for autocrop method

Default value: "r:255,g:255,b:255,a:255"

Applies color code for the autocrop method using RGBA color model –
"r:(0-255),g:(0-255),b:(0-255);a:(0-255)".

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:autocrop color:"r:0,g:128,b:0,a:255"

tolerance: Set tolerance value for autocrop method

Default value: "0"

Applies tolerance value for autocrop method (0-100%). Tolerance parameter specifies the allowed deviation from the color sample specified in the previous color parameter.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper crop method:autocrop color:"r:0,g:128,b:0,a:255" tolerance:50

-oper rotate

pages: Set page range for rotate operation

Default value: all

Defines the range of pages which must be rotated, e.g., pages:1,3,5-12. If not specified, rotation is applied to every page.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper rotate pages:1,3,5-10 angle:180

angle: Define the angle of image rotation

Default value: 0

Rotates the document or image to a certain degree (0-360°). The rotation is clockwise by default.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper rotate angle:30

direction: Select direction for rotation: CW or CCW

Values:
cw (default value), ccw

You can select clockwise (cw) or counterclockwise (ccw) direction for pages' or images' rotation.

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper rotate angle:30 direction:ccw

color: Fill blank margins around the rotated image with color

Default value: "r:255,g:255,b:255,a:255"

Fills blank margins around the rotated image (if they appear) with a certain color using RGBA color model – "r:(0-255),g:(0-255),b:(0-255);a:(0-255)".

Example:

2Printer.exe -src "C:\In\*.*" -prn "MFP LaserJet" -oper rotate angle:30 color:"r:0,g:128,b:0,a:255"

Command lines (-cmdlines)

The -cmdlines switch allows you to set the path to a TXT file that contains the command (or multiple commands) that need to be executed. This can be helpful when the command is very long or if you want to run several commands sequentially. Importantly, this switch enables you to print to multiple printers simultaneously.

Example:

2Printer.exe -cmdlines "C:\Folder\commands.txt"

CMD commands for printing to multiple printers at a time

2Printer Settings

If you don't want to define new print settings in the command line each time, take a look at the default settings of the program – 2Printer Settings panel with GUI controls. From there, you can configure everything only once. To access it, execute this command:

2printer.exe -ini

How to configure 2Printer Settings


The use of command lines makes 2Printer very adaptive to your printing needs. You can combine or modify the command line switches, parameters, and values mentioned above the way you wish – they don’t require strict order. If you have any difficulty setting up your workflows with 2Printer, please let us help you!

CONTACT US