html2ps/pdf FAQ

Back to table of contents
Can I call this script from the command line?
Probably yes; check if your PHP support command line interface. Also, consider reading this article on php.net: Using PHP from the command line
All I'm getting is a blank page; no error messages in PHP error log. Whats happened?
The script is probably running out of memory or execution time. Try increasing the values of max_execution_time and/or memory_limit PHP configuration variables. Recommended values are 120 seconds and 16 megabytes. Nevertheless, if you're using VERY big images, you'll probably need to increase these values even more.
I've increased the limits, but still sometimes get a blank page immediately after the script starts! Some sites are parsed, though...
Some users encountered this problem using the GD library bundled with PHP. While it matched the GD version requirement, it sometimes caused PHP to silently die on some images. The problem is solved by recompiling the PHP using the external (recent enough) GD library. Note that NOT ALL PHP configurations are subject to this problem.
Generated Poscript files print very slowly or even do not print at all

If you're sending PS directly to the printer, you should keep in mind that image-containing PS files require a lot of memory and computational resources to render due to the way it is generated, so the printer may just run out of memory trying to print it.

You may consider using the Ghostscript ps2ps script as a printing filter, this should speed up the printing process, as most computations will be done by computer instead of printer.

I'm getting "PDF doesn't start with "%PDF-" message from Acrobat Reader. Nevertheless, when I save file to my hard drive, it opens perfectly. I'm using Firefox.
There were user reports on issues related to Firefox/Acrobat Reader plugin incompatibility. In particular, this problem appeared with Firefox 1.0.7 and Reader 6.0.2 PL. You may consider upgrading your software to latest versions in this case.
Sites are cut-off on the right side when I'm using 640 pixels page width. What can I do?
Nothing. Treat this as a feature. Just increase the page width. Most sites are NOT designed for such small resolutions and will cause a horizontal scrollbar to appear in browser in such cases.
I've disabled the "Keep screen pixel/point ratio" option and the page layout is completely broken! What can I do?
Nothing. Treat this as a feature. If you want to get the layout close to the image rendered by the browser, never disable this option. The only time you'll need it is when you need to render text having the exact size specified in points.
How should I add headers or footers to generated Postscript?
Use 'position: fixed'. Example
I've added headers and footers to my HTML pages, but how I can prevent them from showing up in the browser?
Use CSS @media rules; as you may specify which set of media rules the script should use during conversion, you may optionally show or hide particular page elements like navigation bars or headers in generated files. Example
How can I use fonts other than standard (Times, Helvetica and Courier)?
Follow these instructions
Cyrillic symbols are not displayed in PS/PS2PDF output
Install sharatype-fonts package to your Ghostscript; the script is configured to use these fonts out-of-the-box.
Chinese (Japanese, Arabic, etc...) symbols do not show on the page. What I need to do?
First of all, you'll need fonts containing these symbols; in most cases default fonts bundled with Ghostscript or PDFLIB will contain only Western/Central European symbols. After you find fonts containing characters you need, you should install them instead of the standard fonts, using the answer for this question «How can I use fonts other than standard (Times, Helvetica and Courier)?»