Given the great comments on PrinceXML all over the Net (and granted, they are true) I decided to evaluate it for a RoR application we're developing.
Using the blog post at that google gives a top result when searching for "princexml rails" everything was up and working fine on both Leopard client, Tiger client and a Ubuntu Dapper Drake box (all using the latest release). The last test was a production xserve 2.8 Ghz Quad-Core Intel Xeon with 2 GB of RAM running Leopard Server 10.5.1.
On that machine (brand new and only running this test application), the same application can't produce PDFs, it bombs with:
Basically the script just runs the following command:
What makes it even weirder, is that running it under a single mongrel web server with only the prince classes parsing the exact same html, it runs fine... for a while.
Parsing the file not using a pipe (just writing the html to disk, then running it through a command line call and reading the resulting pdf back in) does work, but it's very inefficient.
One extra note: the html is XHTML 1.1 valid, not using any special CSS markup or font rendering. Permissions on the server are not the problem either.
Using the blog post at that google gives a top result when searching for "princexml rails" everything was up and working fine on both Leopard client, Tiger client and a Ubuntu Dapper Drake box (all using the latest release). The last test was a production xserve 2.8 Ghz Quad-Core Intel Xeon with 2 GB of RAM running Leopard Server 10.5.1.
On that machine (brand new and only running this test application), the same application can't produce PDFs, it bombs with:
*** Mercury runtime: caught bus error ***
cause: non-existent physical address
address involved: 0x0
This may have been caused by a stack overflow, due to unbounded
recursion.
exiting from signal handler
Basically the script just runs the following command:
/usr/local/bin/prince --input=html --server --log=/var/rails/app/releases/20080201185556/
config/../log/prince.log -s /var/rails/app/releases/20080201185556/
config/../app/views/prints/stylesheets/document.css --silent - -o - <html is inserted here>
and sends the data it receives through the pipe back to the user as a downloadable file.What makes it even weirder, is that running it under a single mongrel web server with only the prince classes parsing the exact same html, it runs fine... for a while.
Parsing the file not using a pipe (just writing the html to disk, then running it through a command line call and reading the resulting pdf back in) does work, but it's very inefficient.
One extra note: the html is XHTML 1.1 valid, not using any special CSS markup or font rendering. Permissions on the server are not the problem either.