Saving the data as PDF

When you save a report in Portable Document Format (PDF), the data is printed to a PostScript file and automatically distilled to PDF using Ghostscript. You can save all types of reports to PDF.

DataWindow Designer uses a PostScript printer driver specifically designed for distilling purposes to configure the PDF output. You can choose to use a different PostScript printer driver if you want to customize your PostScript settings for generating PDF.

Users must have administrative privileges to create a PDF file.

To use a custom PostScript printer driver, you must set some properties.

StepsTo save customized distilled PDF output in the DataWindow painter:

  1. Expand the Data Export category in the Properties window for the DataWindow object and select PDF from the Export drop-down list.

    Select PDF to display options related to saving as PDF.
  2. Select Distill! from the ExportPDFMethod drop-down list and True from the ExportPDFDistillCustomPostScript list.

  3. Expand the Print Specifications category and specify the name of the printer whose settings you want to use in the PrintPrinterName field.

  4. Save the DataWindow object, then, with the Preview view selected, select File>Save Rows As, select PDF as the Save As Type, specify a file name, and click Save.

System requirements

To support saving as PDF using Ghostscript, you must download and install Ghostscript files on your system as described in the chapter on deploying applications in the Programmer’s Guide. You also need to install PostScript driver files. If you have installed a PostScript printer on your computer, these driver files are already installed. If you have never installed a PostScript printer, use the Printers and Faxes option in the Windows control panel to install a generic PostScript printer. If the Pscript5.dll has never been installed, you may be prompted to insert the Windows install CD.

Other related files are installed in Sybase\DataWindow .NET 2.5\drivers.

Saving as PDF fails at runtime on Windows 2003 Server. This is caused by a Group Policy that by default disallows installation of printers that use kernel-mode drivers. Kernel-mode drivers have access to system-wide memory, and poorly written drivers can cause system failures. To allow installation of kernel-mode drivers, follow these steps:

  1. Select Run from the Windows Start menu.

  2. In the Open box, type gpedit.msc and click OK.

  3. In the Group Policy console, expand Computer Configuration, Administrative Templates, and Printers.

  4. Disable “Disallow Installation of Printers Using Kernel-Mode Drivers.”

When you deploy applications that use the ability to save as PDF with the distill method, you must make sure your users have installed Ghostscript and have access to the drivers directory.

The Ghostscript files and the drivers directory must be in the same directory as the pbdwn110.dll runtime file. For example, if you deploy your application and pbdwn110.dll and the other runtime files in a directory called MyApplication, the Ghostscript files must be in MyApplication\gsn.nn, and the PostScript printer driver and related files must be in MyApplication\drivers.

See the chapter on deploying your application in the Programmer’s Guide for information about downloading Ghostscript and redistributing the PostScript printer drivers.