Using the Ghostscript distiller
In order for users to use the SaveAs method to save data as PDF
with the distiller, they must first download and install Ghostscript on
their computers as described in the procedure that follows.
The use of GPL 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 GPL Ghostscript on their computers. A copy of
the GPL is available on the GNU Project Web server at http://www.gnu.org/licenses/gpl.html.
The use of AFPL Ghostscript is subject to the terms and conditions
of the Aladdin Free Public License (AFPL). Commercial distribution of
AFPL Ghostscript generally requires a written commercial license. For
more information, see the Ghostscript website at https://www.ghostscript.com.
To install Ghostscript:
-
Into a temporary directory on your computer, download the
self-extracting executable file for the version of Ghostscript you
want from one of the sites listed on the Ghostscript website at
https://www.ghostscript.com/download/.See the Release Bulletin for the version of Ghostscript that
was used for testing. -
Run the executable file to install Ghostscript on your
system.The default installation directory is C:Program Filesgs. You
can select a different directory and/or choose to install shortcuts
to the Ghostscript console and readme file.
After installing Ghostscript, you should 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 painter, select File>Save
Rows As and select PDF as the Save As type. If you do not install
Ghostscript and use the default export properties, PowerBuilder
displays a pop-up window notifying you that Save Rows As failed. If
you install Ghostscript and then change the name of the directory
where Ghostscript is installed, Save Rows As PDF fails
silently.
Location of files
When you save a DataWindow object as PDF using the Distill!
method, PowerBuilder searches in the following locations for an
installation of GPL or AFPL Ghostscript:
-
The Windows registry
-
The relative path of the pbdwe.dll file (typically
%AppeonInstallPath%CommonPowerBuilderRuntime [version]) -
The system PATH environment variable
If GPL or AFPL 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 pbdwe.dll
file, they must be installed in this directory structure:
|
1 2 3 |
dirnamepbdwe.dll dirnamegsgsN.NN dirnamegsfonts |
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 at https://www.ghostscript.com/doc/current/Fonts.htm.
PostScript printer drivers
If your users have installed a PostScript printer on their
computers, the PostScript driver files required to create PDF files,
PSCRIPT5.DLL, PS5UI.DLL, and pscript.ntf, are already installed,
typically in
C:WindowsSystem32DriverStoreFileRepository
tprint.inf_1a216484Amd64
on a 64-bit Windows system. Your users must use the version of these
files that is appropriate to the operating system where the PDF file is
created. They should copy the files to the dirnamedrivers
directory.
You must also deploy the related files that are installed in
%AppeonInstallPath%PowerBuilder [version]IDEdrivers. These files can
be copied to or installed on users’ computers. They must be located in
this directory structure:
|
1 2 |
dirnamepbdwe.dll dirnamedrivers |
PostScript printer profile
Each user’s computer must have a PostScript printer profile called
Sybase DataWindow PS. Users can add the profile manually using the
Windows Add Printer wizard in one of the following ways:
-
By selecting a printer with PS in its name (such as “Apple
Color LW 12/660 PS”) from the list of printers on the Install
Printer Software page of the wizard, and changing the printer name
to “Sybase DataWindow PS” on the Name Your Printer page. -
(For 32-bit Windows only) By clicking the Have Disk button on
the Install Printer Software page of the wizard, browsing to the
Adist5.inf file (installed with PowerBuilder in the
%AppeonInstallPath%PowerBuilder [version]IDEdrivers directory) or
to another PostScript driver file, and on the Name Your Printer
page, changing the printer name to “Sybase DataWindow PS”.
For how to set properties for the Distill! method, see the section called “Saving as PDF using the Distill! method with
Ghostscript” in Users Guide.