Skip to main content

Print Wizard BANG Commands

Print Wizard (but not AnzioWin) supports a way that a print file itself can specify the output options, such as whether to print or create a PDF, whether to include an overlay, etc. It does this by means of what we call "bang commands", because the command words all start with an exclamation point, or "bang".  For instance, the command "!PDF" tells Print Wizard to create a PDF file. 

A secondary use of bang commands is to break one large print job into pieces, which we call "subjobs". Each subjob can optionally be treated in a different way. As we get into details, you'll see how these two uses are related.

A print file is recognized as a "bang command file" by Print Wizard when it starts with a legal bang command word (more details below).  For example, suppose a print file starts out like this: 

!FAX /x5551212
data to fax line 1
data to fax line 2
etc. ...

Here, the presence of "!FAX" (which is a legal bang command) at the beginning of the file causes Print Wizard to recognize this file as a bang command file. The remainder of the first line is optional parameters as might be allowed for a particular bang command. So this line, up to a linefeed character, is a "command line".  The data on following lines is the actual data to print or fax or put in a PDF, etc.  This continues until either a) the end of the file, or b) another bang command word is found at the start of a line.  This second case is what constitutes breaking a job into subjobs.

As an example, let's assume you have a large file of invoices, in plain text. With bang commands you can up the job, so that each individual invoice becomes a subjob. You can then tell Print Wizard to print, fax, or create a PDF (and maybe email) each subjob based on the bang command line added before each invoice. This makes it easy in your software to specify a different action for Print Wizard to undertake for each invoice, all from within a single print job.

Requirements

The following are requirements for BANG commands to work correctly:

a) A file may optionally start with a 3-byte sequence that identifies it as UTF-8.

b) The file may have initial whitespace, which can consist of the characters null (hex 00), tab, space, backspace, formfeed (hex 0C), carriage-return (hex 0D), and linefeed (0A). This data is ignored.

c) The file consists of lines separated by linefeeds (hex 0A) or return-linefeed (hex 0D 0A) sequences.

d) The first line of a file (after initial whitespace) must start with a legal bang command, beginning with a "!".

e) The bang command line continues until the end of line.  All parts of the command line must be legal parameters for the particular bang command. None of the command line will be considered part of what is to be printed.

f) There is a provision for a bang command to continue to one or more additional lines. This is described below.

g) The data to be printed (or faxed, etc.) begins immediately after a linefeed.

h) The data to be printed can be plain text, or Print Wizard Markup Language (PWML), or data containing escape sequences (such as PCL-5 code).  Different subjobs may have different types of data.

i) A new bang command will be recognized when a legal bang command (starting with "!") immediately follows a linefeed.

Some Examples

The following lines are examples of bang commands:

!ACROBAT /x<fax#> /p<MAPI profile> /e<email address> /t<to> /j<subject> /n<note> /a<attachment>

!FAX32 /x<fax #> /t<to> /j<subject> /n<note> /a<attachment>

!MAPISEND (passes any mapisend switch)

!PREVIEW /p<printer> /f<print to filename>

!PRINT /p<printer> /f<print to filename>

!PDF /f<filename> /email=<email address>

!RUN (passes any switches you wish to include)

!WINFAX /x<fax #> /t<to> /j<subject> /n<note> /a<attachment>

BANG Commands

The following is a list of BANG commands available in Print Wizard, updated for Print Wizard 4. Refer to the Print Wizard manual and the ReadMe file that ships with Print Wizard for more up-to-date information on BANG commands.

!ACROBAT

!Acrobat is a special “bang” command for creating a PDF file through the Adobe Acrobat printer driver (provided with Acrobat Professional or Acrobat Standard, NOT available with the Acrobat Reader only), generating a PDF from the following data. If you include email information, this command can email it automatically using MAPISEND and the MAPI protocol.

!ACROBAT /x<fax#> /p<MAPI profile> /e<email address> /t<to> /j<subject> /n<note> /a<attachment> /f<filename> /preview

(included for backward compatibility with prior releases – you can do this with Print Wizard's !PDF BANG command).

!EMAIL

!Email will send whatever data follows it as an attachment to an email using the default email settings in Print Wizard.

!EMAIL /email=<emailaddress> /J<subject> /N<notes> /T<to name> ...

!FAX

!Fax will fax whatever data follows to a specified fax number using the default fax settings in Print Wizard.

!FAX /x<fax #> /t<to> /j<subject> /n<note> /a<attachment> /c<cover pg file>

!FAX32

!Fax32 will fax the data that follows to a specified fax number using the Windows Fax driver.

!FAX32 /x<fax #> /t<to> /j<subject> /n<note> /a<attachment> /c<cover pg file>

!FILE

!File will write the data that follows out to a work file named in the options.

!FILE /f<output filename>

!MAPISEND

!MapiSend saves all the following data off to a file and attempts to email or fax it via the MapiSend program. Any included switches are passed on to the stand-alone MapiSend program. See the manual for more documentation on the MAPISEND utility.

!MAPISEND (passes any mapisend switch)

!PARAMS

!Params is a new command that allows you to preset certain global variables. This allows you to preset any of the BANG parameters found below. Note that these will then affect all remaining jobs, not just the next subjob. On the other hand, options included on the same line with a BANG command, only affect that subjob.

!PARAMS /n<notes> ... (see examples below)

!PDF

!PDF utilizes the Print Wizard engine to generate a PDF of the following information. If a “/email” option is included, the PDF file is then emailed to the specified email address through the default email settings.

!PDF /f<filename> /overlay=<overlay name>

!PREVIEW

!Preview is the same as !Print except that the file will always be shown in the Print Preview dialog before printing.

!PREVIEW /p<printer> /f<print to filename>

!PRINT

!Print prints the data that follows to the default printer or to the specified printer.

!PRINT /p<printer> /f<print to filename>

!RESET

!Reset resets the options set by the prior !Set command (see the description below).

!RESET

!RUN

!Run allows you to include your own string to do whatever you want with the data. The data that follows is written to a file and that file name is then passed to the script or application of choice as a command-line parameter. You can also specify specific default actions to take, such as "start", "print" and "printto". If a file association exists for a file extension, the <program> parameter can be a file name rather than an application name.

!RUN <program> (pass any switches you wish to include) %1
!RUN start %1
!RUN print %1
!RUN printto <printername> %1

!RUNWAIT

Similar to !Run, !Runwait allows you to include your own string to do whatever you want with the data. The data that follows is written to a file and that file name is then passed to the script or application of choice as a command-line parameter. The difference is that Print Wizard will pause processing the rest of the file until a return code is returned from the application specified - make sure you know what you are doing and the consequences if the application never returns control to Print Wizard.

!RUN <program> (pass any switches you wish to include) %1
!RUN start %1
!RUN print %1
!RUN printto <printername> %1

!SET

!Set sets a specific key entry in the Print Wizard profile or default file that is in use. Note that this sets these globally. Unlike !Params which acts on BANG parameters only, !Set allows you to change specific global defaults by key and value. Each key/value combination is included as a line of data following the !SET command.

!SET
key=value
key=value
...

!WINFAX !Winfax is included for support of Symantec's WinFaxPro application. This allows you to fax through the WinFaxPro software (compatible with version 10.2 or earlier.

 

By default, the !RUN and !RUNWAIT commands are disabled. You can enable them by manually editing the Print Wizard default file (“printwiz.ini”) in Notepad and setting the option "allowbangrun" to 1 (true). Caution should be taken when editing this file and when turning on this option. Call if you have any questions.

BANG Parameters

While not all BANG parameters are applicable to all BANG commands, they are listed together here. Many are interchangeable and do have some affect. Always test when using optional BANG parameters to make sure the results are what you anticipate.

/A<attachments>

You can specify optional attachments to be included f faxing, emailing or printing.

/amyfile.pdf
/a"c:\temp\mypdf.pdf"
/ac:\temp\text.pdf,c:\temp\test2.pdf,c:\temp\test3.pdf
/ahttp://www.aaaa.com/pub/mypdf.pdf

/COPIES=<#>

Specify a number of copies to print the subjob with.

/copies=3

/COLLATE=on/off

Specify the printer collate option.

/collate=on

/C<coverpage>

Set a fax coverpage file name.

/cC:\TEMP\Coverpg.cov

/DELAY=<#>

Specify a short delay, in seconds, before the processing of this subjob. This is used to slow down the process if you are waiting on a prior subjob to finish.

/delay=10

/EMAILBCC=<emails>

Specify blind carbon copy email addresses.

/emailbcc=abc@somewhere.com
/emailbcc=abc@somewhere.com,xyz@somwhere.com

/EMAILCC=<emails>

Specify carbon copy email addresses.

/emailbcc=abc@somewhere.com
/emailbcc=abc@somewhere.com,xyz@somwhere.com

/EMAILFROMADDRESS=<email>

Specify an "email from address" for outbound emails. This works with some email methods and not with others. Refer to the manual for more information.

/emailfromaddress=pwsubjob@somewhere.com

/EMAILFROM=<email from>

Specify a name for who the outbound email comes from. This works with some email methods and not with others.

/emailfrom="my PW run"

/EMAILHTML=on/off

Allow the body of an email to be HTML.

/emailhtml
/emailhtml=on
/emailhtml=off

/EMAIL=<email>
/E<email>

The email address to send to.

/email=abc@somewhere.com
/email=abc@somewhere.com,xyz@somewhere.com
/eabc@somewhere.com

/FAXCOVERPG=<coverpage>

Set a fax coverpage file name.

/cC:\TEMP\Coverpg.cov

/FAXFROMNUM=<#>

Specify the fax from number.

/faxfromnum=5551212

/FAXFROM=<from name>

Specify the fax from name.

/faxfrom="Jane Doe"

/F<printto name>

Specify the file to print to. This can be a superfile name (refer to the Print Wizard documentation), a PDF name to generate or just the file name to print to.

/ftif://mytiffile.tif
/f"C:\my files\mypdf.pdf"
/fmyprintfile

/I

Use this to specify multiple lines of message body for emails. All data following the /i<line feed> will be included as the body of an email, rather than as an attachment.

/i
my message body line 1
my message body line 2
my message body line 3

/J<subject>

Specify an email or fax subject line.

/j"My subject line"

/N<notes>

Specify the notes for the message body of a fax coverpage or for an email. This can reference a file name or it can be the actual text to include in the body.

/nC:\temp\myemailbody.txt
/n"my notes line 1|line 2|line 3"

A vertical bar is used to represent a carriage return within a line.Note that you may be limited by the length of a command line when doing this. In this case you can either reference a file name, use the /i option above, use the line continuation character described below or preset the variable for notes with a !PARAMS or !SET.

/OVERLAY=<filename>

Specify an overlay file name to use for PDFs or printing of the subjob.

/overlay=c:\temp\testoverlay.pcl

/PREVIEW

Turn on print preview.

/preview

/POSTVIEW

After generating a PDF, show the PDF inside Acrobat Reader.

/postview

/P<printername>

Specify a different printer for this subjob. This can be a wildcard selection.

/p"HP PSC 2100 PCL"
/p"HP*"

/P<profilename>

If the BANG command is !Acrobat or !Mapisend, the /P<> will represent the Outlook/MAPI profile to use rather than the printer name.

/pOutlook

/T<to name>

The TO name for an outbound email or fax.

/t"email name"

/VIEW (see /PREVIEW)
/X<fax number>

Specify the fax to number.

/x5035551212

 

Line Continuation

Occasionally you will run into situation where a set of parameters for a BANG command pushes the limits of what your software can send in one string or of the length of command line that can be passed in one variable. A back-slash, "\", can be used as a line continuation character. It needs to be listed as the last character on that line before a line feed. The next line will then be concatenated with it. For example:

!pdf /email=abc@somewhere.com /j"subject line is here" /emailcc=bde@somewhere.com \
/n"my notes line 1|line 2|line 3"
data line 1 for the pdf attachment
data line 2
data line 3

Example

Here is an example of a typical file containing a fax, print and the emailing of a pdf of a simple message:

!fax /x5035551212 /t"John Doe"
We have just released a new patch release of Print Wizard that we believe would help with your
current problems relating to the security of Windows Vista. Please check out our web site for
the most current download.
!pdf /email=jandoe@somewhereelse.com /j"A new release of Print wizard" /t"Jan Doe" \
/n"Jan,||Attached is a brief description of the new features in Print Wizard.||Support"
Print Wizard 3.2.30 patch release is now available. Check out some of these new features:

o Email direct from the user interface
o <img> image tabs in PWML now support transparencies
o /interactive now provides a way for a user to determine the target for any print job at runtime
o Despool and Listen services have been cleaned up and optimized
o Outlook security statements and warnings are now suppressed

Updates run 50% of list price for older versions. If you are running on version 3, the patch release is free. Visit our web site for more information.
!print /p"HP PSC 2155 PCL"
Emails and faxes for today have been sent.
Check the log file for details.

Thank you.

Print Wizard.

 

 

Last review and edit: Oct. 20, 2011

Copyright © 2021 Rasmussen Software, Inc. Legal Information & Privacy Policy
Send comments and suggestions to rsi@anzio.com