Forum Bugs

Prince 9: define a pdf-author und -creator by command line

evo01
We convert html-files to pdf-files by command line width prince 9.

If we set the pdf-author and -creator width multiple words, we geht warnings and errors. I think, price will load other files and use only the first defined word as author and creator.

prince --pdf-author='This is a test author' --pdf-creator='This is a test author' -s 'style.css' 'index.html' -o 'test.pdf'


Output:
prince: warning: failed to load external entity "is"
prince: is: error: could not load input file
prince: warning: failed to load external entity "a"
prince: a: error: could not load input file
prince: warning: failed to load external entity "test"
prince: test: error: could not load input file
prince: warning: failed to load external entity "author"
prince: author: error: could not load input file
prince: warning: failed to load external entity "is"
prince: is: error: could not load input file
prince: warning: failed to load external entity "a"
prince: a: error: could not load input file
prince: warning: failed to load external entity "test"
prince: test: error: could not load input file
prince: warning: failed to load external entity "author"
prince: author: error: could not load input file


If I define a single word like:
prince --pdf-author='testauthor' --pdf-creator='testauthor' -s 'style.css' 'index.html' -o 'test.pdf'

everything is fine.

I used the command line documentation to find help, but the arguments of the params are not specified in detail.
mikeday
That should be fine, how are you running Prince? Manually from the command-line, or via another program or system call?
evo01
I start prince manually on unix-command line and via PHP with the PHP wrapper class from here.
mikeday
It should work when you run it manually; what if you use double quotes instead of single quotes? Which operating system are you running on, and do you know which shell you are using?
evo01
I testet it with double quotes and single quotes, but the result was the same.

the system are: Linux version 2.6.32-5-amd64 (Debian 2.6.32-45)

the shell are bash and the PHP-version of this development system are 5.2.17.

Edited by evo01

mikeday
Hmm, maybe it is the Prince shell script that is the problem. If you check /usr/bin/prince you should see a file like this:
#! /bin/sh

exec /usr/lib/prince/bin/prince "$@"

If it looks different, that may be the problem. Alternatively, you could try running /usr/lib/prince/bin/prince directly, to ensure no command-line arguments are being unquoted.

This is very strange though, as it should just work out of the box on Debian.
evo01
Our shell script looks like
#!/bin/sh

exec /usr/lib/prince/bin/prince $@

on Prince 9.0 rev 5.

I tried to run /usr/lib/prince/bin/prince and it works - strange.
mikeday
Okay that is our mistake, if you wrap the $@ in double quotes like my example above, then it should work fine.
evo01
Yes, I have seen, but I don't have the permission to edit that file. I ask our administration, but they want to wait for the next release - no customizing on external scripts. So I call prince directly till the next release are installed. :)