Printer - Print document

Declaration

<AMPRINTER ACTIVITY="print" FILE="text" URL="YES/NO" SITE="text" PRINTER="text" COPY="number" />

Related Topics   

Description

Prints the document specified using the default printer or optionally, using a specific printer or all available printers.

Practical usage

Used to instruct an application to print a document. This activity impersonates the act of manually right-clicking on a file by way of Windows Explorer and selecting Print. The document must have an application associated with it that can perform printing externally such as Notepad for .txt files or a word processor for .doc or docx files. Also, the application must support printing in this manner.

Parameters

General

Property Type Required Default Markup Description
Document Text No (Empty) FILE="C:\folder\readme.txt" If enabled, specifies the path and file name of the document to print (enabled by default). Selecting this parameter disables the URL parameter. Automate Desktop will determine the associated application and request that it prints the document.
NOTE: The application must support printing in this manner.
URL Text No (Empty)
  • URL="yes"
  • SITE="http://www.Fortra.com"
If enabled, specifies the URL or web address of the web page to print (disabled by default). Selecting this parameter disables the Document parameter.
Print on Text Yes Enabled
  • PRINTER="default"
  • PRINTER="specific"
  • PRINTER="allavailable"
Specifies the printers the document should be printed on. Since only the default printer supports the ability to print URLs, this parameter is available only if the Document parameter is enabled. The available options are:
  • Default - The document is printed on the default printer.
  • Specific - The document is printed on a specific printer.
  • All - The document is printed on all available printers.
Specific printer Text Yes, if Print on is set to Specific Disabled PRINTER="Brother MFC-9840C" If enabled, specifies the name of the printer that to use to print the document. This parameter is required if the Print on parameter is set to Specific.
Number of copies Number Yes 1 COPY="2" The number of copies to print.

Description

Error Causes

On Error

Examples

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Example 1

This sample task prints a document to a specific printer.

Copy
<AMPRINTER ACTIVITY="print" FILE="C:\temp\myDoc.pdf" PRINTER="Brother MFC-9970CDW (Development)" COPY="2" />

Example 2

This sample task prints a document on all available printers.

Copy
<AMPRINTER ACTIVITY="print" FILE="C:\Documents\FAQs\faq.doc" PRINTER="allavailable" />