Using URL-Based Automation |
You can automate certain print actions for Print Portal by adding query parameters to the Print Portal URL address for the document in your browser window when you access the Print page. The URL scheme to use is as follows.
http://[ServerName]/BarTender/Print/[RootFolderNameOrID]/[RelativePathToDocument]?[parameters]
The following query parameters are available:
Copies (integer): Specifies the number of identical copies to print for the document, if the document supports changing the number of copies.
SerialNumbers (integer): Specifies the number of serialized items to print, if the document supports serialization.
Printer (string): Specifies the printer that you want to print the document to. This parameter value must exactly match a printer name for a printer that is already configured for use with Print Portal. This parameter is case-sensitive.
Task (string): Specifies whether the print job starts immediately or the page opens in Print Preview. Valid values for this query string are "Print" and "PrintPreview". If the selected printer is a client printer, the requested task is completed after the client print module has successfully loaded. The behavior is the same as if you had manually clicked Print or Print Preview, so if any data entry is required, the data entry form opens first.
ReturnAfterCompletion (Boolean): Specifies how Print Portal behaves after a specified task ("Print" or "PrintPreview") is completed. When this parameter is set to true, the default behavior is specified. For example, after a successful print task (including data entry if appropriate), Print Portal returns to its browser page. When this parameter is set to false, the Print page remains open after the successful print task.
<Data Entry Control Name>=<value> (string): Sets the default value of a data entry control. This parameter is case-sensitive.
<NamedDataSource>=<value> (string): Specifies one or more named data sources to use for the print job. This parameter is case-sensitive.
The following URL specifies that you want two serialized items to be printed for a document that is named "serial.btw", which is located at the base level of the root folder.
http://localhost/BarTender/Print/[RootFolderNameOrID]/serial.btw?SerialNumbers=2
The following URL specifies that you want five identical copies to be printed for a document that is named "AIAG_PT1.btw", which is located in the "New Folder/AIAG" folder of the root folder. It specifies that the copies are printed to the "Easycoder IP" printer.
http://localhost/BarTender/Print/[RootFolderNameOrID]/New%20Folder/AIAG/AIAG_PT1.BTW?Copies=5&Printer=Easycoder%20IP
The following URL is the same as in the preceding example except that the document is automatically printed (or shows the data entry form if required) when the client print module has loaded.
http://localhost/BarTender/Print/[RootFolderNameOrID]/New%20Folder/AIAG/AIAG_PT1.BTW?Copies=5&Printer=Easycoder%20IP&Task=Print
The following URL is the same as in the preceding example except that the document automatically displays a print preview (or shows the data entry form if required) when the client print module has loaded.
http://localhost/BarTender/Print/[RootFolderNameOrID]/New%20Folder/AIAG/AIAG_PT1.BTW?Copies=5&Printer=Easycoder%20IP&Task=PrintPreview
The following URL sets the default value of the "Text Input Box 1" data entry control to a value of "Sample Text".
http://localhost/BarTender/Print/[RootFolderNameOrID]/[DocumentName].btw?Text%20Input%20Box%201=Sample%20Text
The following URL specifies the named data sources that are used for the print job. In this example, the named data sources are "Surname," "StreetAddress," "City," "State," and "ZIPCode."
http://localhost/BarTender/Print/[RootFolderNameOrID]/[DocumentName].btw?Surname=Jones&StreetAddress=206%20Elm%20Avenue&City=Fremont&State=WA&ZIPCode=98129