Saving as PDF using the distill method

If you want to save to PDF using the distill method, you do not need to change any properties. The distill method is used by default when you select Save Rows As from the File menu in the DataWindow editor and select PDF as the file type, or when you use the SaveAs method with PDF! as the file type.

Sybase WorkSpace 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.

In the DataWindow editor

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

StepsTo save customized distilled PDF output in the DataWindow editor:

  1. Select the Data Export tab in the Properties view for the DataWindow object.

  2. Select PDF from the Format to Configure drop-down list, select Distill! from the Method drop-down list, and select the Distill Custom PostScript check box.

  3. Select the Print Specifications tab and specify the name of the printer whose settings you want to use in the Printer Name box.

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

System requirements for the distill method

Users must have administrative privileges to create a PDF file.

To support saving as PDF using GNU Ghostscript, you must download and install Ghostscript files on your system as described in the procedure that follows.

The use of GNU Ghostscript is subject to the terms and conditions of the GNU General Public License (GPL). Users should be asked to read the GPL before installing GNU Ghostscript on their computers. A copy of the GPL is available on the GNU Project Web server

StepsTo install GNU Ghostscript:

  1. Into a temporary directory on your computer, download the self-extracting executable file for the version of GNU Ghostscript you want from one of the sites listed on the Ghostscript Web site

  2. Run the executable file to install Ghostscript on your system.

    The default installation directory is C:\gs. You can select a different directory or choose to install shortcuts to the Ghostscript console and readme file.

After installing Ghostscript, read the readme.htm file in the doc subdirectory in the Ghostscript installation directory to find out more about using Ghostscript and distributing it with your application.

Save Rows As fails

To save as PDF in the DataWindow editor, select File>Save Rows As and select PDF as the Save As type. If you do not install GNU Ghostscript and use the default export properties, Sybase WorkSpace displays a pop-up window notifying you that Save Rows As failed. If you install GNU Ghostscript and then change the name of the directory where GNU Ghostscript is installed, Save Rows As PDF fails silently.

Location of files

When you save a DataWindow object as PDF using the distill method, Sybase WorkSpace searches in the following locations for an installation of GNU Ghostscript:

If GNU Ghostscript is installed using the Ghostscript executable file, the path is added to the Windows registry.

If the Ghostscript files are in the relative path of the pbdwe105.dll file, they must be installed in this directory structure:

dirname\pbdwe105.dlldirname\gs\gsN.NNdirname\gs\fonts

where dirname is the directory that contains the runtime DLLs and N.NN represents the release version number for Ghostscript.

You might not need to distribute all the fonts provided in the distribution. For information about fonts, see fonts and font facilities supplied with Ghostscript

You must also deploy the default PostScript printer driver and related files that are installed in Sybase\WorkSpace\sybase_workspace\database_components\dlls\drivers. These files can be copied to or installed on users' computers. They must be located in this directory structure:

dirname\pbdwe105.dlldirname\drivers

PostScript printer profile

Each user's computer must have a PostScript printer profile called Sybase DataWindow PS. This profile is added to your development computer automatically when you save a DataWindow's rows to a PDF file in the DataWindow editor.

Users can add the profile manually using the Windows Add Printer wizard. In the wizard, click the Have Disk button and browse to the Adist5.inf file installed in the Sybase\WorkSpace\sybase_workspace\database_components\dlls\drivers directory, or to another PostScript driver file.

Installing PostScript drivers

The PostScript drivers installed with Sybase WorkSpace do not support searchable PDF and do not handle tables correctly if they have more columns than can fit on a single page. You can use a PostScript driver from another vendor as an alternative. If you do not already have a PostScript printer or printer driver installed on your system, use the Windows Add Printer wizard to add a PostScript printer.

StepsTo add a PostScript printer to your printer settings:

  1. Select Settings>Printers from the Windows Start menu.

  2. Double-click Add Printer.

  3. Specify a local printer.

  4. Specify FILE: as the port.

  5. Select a manufacturer (such as HP) and a printer with the designation PS (such as HP Color LaserJet PS or HP LaserJet 4/4M Plus PS 600).

  6. Accept the default name or enter a shorter name for the printer.

  7. Complete the wizard.

StepsTo use the alternative print driver in your Java code:

  1. Set the Distill.CustomPostScript and Printer properties.

    For example:

    jsfdw.modify("DataWindow.Export.PDF.Distill.CustomPostScript = 1")
    
    jsfdw.modify("DataWindow.Printer = HP LaserJet 4/4M Plus PS 600")