Knowledgebase article

Print Wizard BANG commands

There is a number of what we call “BANG” commands that can be added to the content of a print file to cause job separation to take place during the processing of the file. This allows you to separate one large print job into different tasks that may not be related. A typical BANG command would be an exclamation mark followed by a valid command from the list below, i.e.

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

In most print situations a single print job always had the same target in mind, printing. With BANG commands you can separate this into smaller jobs and include the ability to print, fax, generate a PDF or email a specific subjob on the fly.

As an example, let's assume you have a large file of invoices. With BANG commands we can split each individual invoice into a subjob. We can then email, fax, create a PDF or print these subjobs based upon the BANG 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

There are a couple of requirements for BANG commands to work correctly:

a) The first line of a file must start with a BANG command (before any printable data, there must be an exclamation mark followed by a valid BANG command).

b) A BANG command must start on a new line (after a line feed or as the first line of the file), and begins with an exclamation, “!”, and includes the type of output you want along with any related parameters.

c) The data to process begins on the first line after a line feed. The line feed terminates the parameters for a BANG command.

Some Examples

BANG commands are similar to including PWML tags in the print data, except that the BANG commands separate a single job into multiple subjobs, instructing Print Wizard how to handle each new subjob. Here are some typical examples:

!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 (update for Print Wizard 3.2). 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 push 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 a 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.

!pdf /email=abc@somewhere.com /j"my 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.

 

Applies to

Print Wizard v3.2 or later

Date
October 2, 2008
Links
Knowledgebase index
Documentation
 
Related Documents

No related documents



Copyright © by Rasmussen Software, Inc. All Rights Reserved Legal Information
Send comments and suggestions to rsi@anzio.com