Job.setPrinterName method

setPrinterName

void setPrinterName(String sPrinterName)

Sets the name of the output device (file or printer).

You can assign one of the following values:

  • Printer name
    Any local or network printer name as defined on Windows or Linux/UNIX (CUPS).
    Use optional output-format prefixes to select a repository printer or to use direct PostScript printing, etc.

  • Output format prefix and file name
    Use an output-format prefix such as PDF: followed by the file path (see Printing and Export).
    A filename extension alone does not select an output format.

For file output, you can alternatively use setPrinterType with setOutputName. For Windows printer output, setOutputName can additionally specify the spool-job name; it does not select the printer.
An output-format prefix in setPrinterName implicitly selects the output type; a file-output prefix also sets the filename. See Printing and Export for how these settings interact.

Parameters

Parameter / typeDescription
sPrinterNameString

The type and name of the output device

Note

Call this function before generating output when selecting a printer or using an output-format prefix. It is not required for file output selected with setPrinterType and setOutputName.

Search documentation

Search in
More scopes
Additional scopes

All contents