Description

Determines which print attributes are supported by a selected printer.

Returns

A structure that contains the attributes supported by the printer. If the printer is not specified, the structure contains attributes supported by the default printer, if one exists.

Category

System functions

Function syntax

GetPrinterInfo("printer")

See also

cfpdf,  cfprint, GetPrinterList

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

printer

The name of a printer. An example in Windows is “\\s1001prn02\NTN-2W-HP_BW02”. The default is the default printer for the account where the ColdFusion server is running. Printer names are case sensitive and must be entered exactly as they appear in the System Information page of the ColdFusion Administrator.
If you specify an empty string, for example GetPrinterInfo(""), ColdFusion generates an error. Use the following code to retrieve information on the default printer:{{ GetPrinterInfo().}}

Usage

Use this function in conjunction with the cfprint tag when processing large print jobs. Not all printers support the complete list of print attributes allowed by the cfprint tag. If the selected printer does not support a print attribute, the printer ignores the attribute.In Windows systems, the account running the ColdFusion server must have PRINTER_ACCESS_USE access rights for each printer it uses. Even if the printer is configured locally on the system, the printer is not available if the account in which ColdFusion is running does not have the proper permissions.

Example

<!--- The following code returns information on the default printer. --->
<cfdump var="#GetPrinterInfo()#">

<!--- The following code returns information on the specified printer. --->
<cfdump var="#GetPrinterInfo('\\S1001prn02\NTN-2W-SHARP01')#">

 

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy