Printing to pdf
From 4DWiki
Contents |
[edit] Printing to pdf from 4D
[edit] Printing to pdf from 4D on Windows
[edit] Printing to pdf from 4D on Windows using Ghostscript
This is an interesting method to print pdf from 4D running on Windows. I haven't tried it...
Subject: Re: PDFs from Windows
Date: Thu, 8 May 2008 12:50:57 +0500
From: "Shazia K. Rahim"
To: 4d_tech@lists.4d.com
A couple of years ago, Jens Blomster posted the following technique to generate free PDFs on Windows via Ghostscript from 4D. Here's his description:
- install a quality postscript printer driver, for instance Apple ColorLaserWriter 12/600. It's on the WinXP cd distribution.
- configure the printer to print postscript to a "local port" which is a tempfile, named for instance C:\pstemp.ps
- download and install GNU Ghostscript
- in 4D, when you want to print pdf, use Win32API to change printer to the LaserWriter
- Print! You will generate a postscript file at C:\pstemp.ps. Test when it's ready (it is ready when it exists and is possible to open for writing, for instance)
- use AP Sublaunch or shellExecute to fire the command ps2pdf C:\pstemp.ps C:\mypdf.pdf
- test when the pdf is ready, in same way.
code ?

