On this Page

    _printer.setOutputFile

    Syntax

    _printer.setOutputFile(filename[, printername])

    Parameters

    The setting of the output file name can take effect only when output generation for the current document, if any, finishes, and output generation for the next document begins.

    filename - The file names provided here can use embedded Field name references to dynamically name the output file based on the current data values. See also % substitutions in File Naming Conventions. Further, output file names can be prefaced with: prt::, file::, or run:: to more explicitly identify output destinations.

    printername - In some systems, a printer name can include a slash (/). That makes the name look like a file name and hence it is a good idea to preface actual printer names with prt::. And conversely, it could help to specify that a file name is meant to be a real, on disk, file name, by prefacing the name with file::.

    Rare

    If file:: is used with a WIN-based output configuration, it signifies that Merge is to instruct the Windows printer driver to send its raw output to a file on disk. This works for only some Windows printer drivers but has been known to be of use to capture such things as the raw ZPL destined for a Zebra label printer. When using this option with a WIN output configuration you need to identify that actual Windows printer that the output would normally go to if you weren't choosing to direct it to a file. You do that by using the -outputRef command line option. It identifies an actual printer, whose Windows driver will be asked to send its output to your nominated file:: location instead. Your mileage may vary.

    The use of the run:: prefix is described in Output Filenames / Options. It is exceptionally handy, especially during form+data development where quick onscreen results can be seen by passing, for example, PCL output to GhostPCL to render it to a PDF format, or any other variation you might think of re: doing post-processing on whatever output was generated.

    On Linux systems, it is also possible to suffix the output destination name with ,p. This instructs Merge to interpret the destination name as a program name (e.g. lpr) and to pipe the generated output to that program.