Syntax

PDEST 'name' FILE

Arguments

name: text

Meaning

The FILE option indicates that the destination is a file.

From Collections 1.10, for adapl-only output formats (which must be set up as output formats with the Template type set to Custom), you can have these generate output as a plain text file (which can also be a .csv file, because that is plain text too) or as a PDF* file: by "adapl-only" we mean that the output format only needs an adapl with PRINT and OUTPUT statements to generate plain text output and optionally PDEST <file_name.extension> FILE to specify the file name and extension/mime type (so you do not combine the adapl with a Word template or XSLT stylesheet in this case).
If the provided file name extension is .csv, it will return a plain text file with mime type text/csv, while if the extension is .txt the mime type will be text/plain. If you leave out a PDEST command altogether or include it but leave out the FILE, parameter, then the generated output will automatically be converted to a PDF. In the PDEST command you only need to provide the file name with the extension, but it's no problem if the file name is preceded by a path (which might be the case in an existing adapl output format): the path will be ignored anyway.
Collections will stream the generated file to the user, after which he or she can print or save it at will.

Note that in a web environment you can't write to a path outside the virtual directory. Writing to a (mapped) folder within the virtual directory is a possibility but this will recycle the application pool after a certain amount of writes.

* PDF output through adapl-only output formats is limited to left-to-right languages. Languages like Arabic cannot yet be created even with Unicode fonts. Also Chinese, Japanese and Korean languages are not supported.) Instead, try using a Word template or XSLT stylesheet to create the output format: these methods do support the mentioned languages.