View All

Auto-Print Commands and *.bat File Creation

Auto-Print Commands and *.bat File Creation

Auto-Print Feature

One of the advanced print features that can be used with Bodno is the Auto-Print, which provides the ability to automate print jobs through the Windows Command Prompt (cmd.exe) or an external application/file capable of using the commands.

In this technote we will address the existing commands, how to use them and we will show how to create a Batch file *.bat to run the previously saved commands.

To download our Auto-print samples files click here.

We will need to remove the rem from the .txt file to uncomment the commands to be used. Please note that to work with the Auto-Print, the card you are going to use must be previously saved with your printer settings already configured.

The commands usable to interact with Bodno are:

 

/P or /PRINT – is the command to Print

 

/FILTER:"data" – in "data" is where we can add the desired Flag for the Conditional Print Filter. Note that to use the /FILTER:”data” command, the card must be saved with the conditional print selected in the print dialog.

 

a screenshot showing the conditional print settings.

 

/CONTINUOUS:seconds – condition sent for Bodno to automatically restart after printing with “X” seconds as delay, default is 10 seconds.

 

/DBFILTER:"Filter" – where "Filter" is the equivalent to a SQL WHERE clause and the search syntax has to be respected.

 

This syntax can be checked using the Database Filter tab in Bodno and it will be like this:

 

/DBFILTER: "`Employee ID` = 10"

 Screenshot showing printing syntax.

 

/SAVE:"optionalFileName" – Saves the document opened in the command line applying all changes made by Print or DBFilter. If an optionalFileName is specified, then the card document will be saved with the new name.


For example:

/SAVE – saves the document with the current file name

/SAVE:"D:/Tickets/newCard.card" – saves the document at the path location with the specified name

 

Using the Save command with a filter allows you to preview the card fields filled with data that meets the determined conditions before printing.

/SHOWPRINTDIALOG – always show Print Dialog Box

/NOMAINWINDOW – hides Bodno main GUI (Graphical User Interface).

/PRINTERNAME:"Your Printer Name" – defines a new printer to be use, instead of the predefined one in
the .card file.

For example:

/PRINTERNAME:"Evolis Primacy" – independent of the printer configured in the selected .card file, the
print job will go to a printer named Evolis Primacy.

/PRINTPREVIEW - adds a dialog that display a card preview before printing.

 

/PRINTPREVIEW:NOBUTTONS - the preview dialog is shown without buttons (Continue\Interrupt)


/EXIT – Forces Bodno to Close & Exit after printing

 

The syntax to be used is:

"X:\PATH\TO\Bodno.exe" "X:\PATH\TO\YOUR.card" /command /command...

Note that the location of the Bodno.exe file may vary depending on your operating system and the location you selected when installing Bodno.

The normal path for x86 systems is "C:\Program Files\Bodno\Bodno.exe".

The normal path for x64 systems is "C:\Program Files (x86)\Bodno\Bodno.exe".

The card file location is where you saved your Bodno.card document.

Auto-print commands can be run directly either from the Windows Run dialog box, from the Windows Command Prompt, from a Batch file, or a customized application.

To run a Auto-print command from the Windows Run dialog box, open the dialog box through the Windows Menu Start>Run type the Auto-print command in the dialog box and click the OK button:

 

To run the Auto-print command from the Windows Command Prompt, open the command prompt through the Windows menu Start>Accessories>Command Prompt.

And type the Auto-print commands inthe Command Prompt window:

 

 

The Auto-print commands can be stored in a batch file (.bat) for later use. This way, you can create as many batch files as you like, each with its custom settings, and run your desired file with the desired settings whenever it's needed.

You can create a batch file in any regular text editor like Notepad by starting a new text document. Type in the commands you want to run and save the file with the extension (.bat).

You can then run the .bat file directly by double clicking the file, or through an external program such as the Windows Task Scheduler.

 

If you need more help, don't hesitate to email Support@Bodno.com.