27 mar 2010 kl. 05.41 skrev Rob Gould:
Is there a free solution out there that will enable me to take a PHP-
generated postscript output file, and dynamically, on-the-fly
convert it to a PDF document and send to the user as a download when
the user clients on a link?
More description of what I'm trying to do:
1) I've got a web-page that accepts some user input
2) They hit SUBMIT
3) I've got a PHP file that takes that input and generates a custom
Postscript file from it, which I presently serve back to the user.
On a Mac, Safari and Firefox automatically take the .ps output and
render it in Preview.
4) However, in the world of Windows, it seems like it'd be better
to just convert it on-the-fly into a PDF, so that the user doesn't
need to worry about having a post-script viewer app installed.
If your webserver runs on MacOSX, look out for a binary called
'pstopdf'. From the man page:
[...]
pstopdf is a tool to convert PostScript input data into a PDF
document. The input data may come from a file
or may be read from stdin. The PDF document is always written to
a file. The name of the output PDF file is
derived from the name of the input file or may be explicitly
named using the -o option.
[...]
Another option might be xpdf (http://www.foolabs.com/xpdf/). There are
several different tools bundled with that app and there might be some
ps -> pdf converter too.
Otherwise, there is always Ghostscript.
/frank
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php