wkhtmltopdf

By Djulia - August 31, 2010

Hi,

It is possible to use the options available directly in the plugin (createPDF.php)?
http://madalgo.au.dk/~jakobt/wkhtmltopdf-0.9.5-doc.html

I would like to test the values of :
General Options
Headers And Footer Options
Table Of Content Options

Thanks, Djulia

Re: [Djulia] wkhtmltopdf

By Chris - August 31, 2010

Hi Djulia,

There's nothing built into the plugin right now to allow this, but you can add your own command-line switches if you're feeling adventurous! Simply add options to the string on line 97:

$switches = "-q --disable-internal-links"; // command line switches: http://madalgo.au.dk/~jakobt/wkhtmltopdf-0.9.5-doc.html

...for example:

$switches = "-q --disable-internal-links --header-center \"Hello World\""; // command line switches: http://madalgo.au.dk/~jakobt/wkhtmltopdf-0.9.5-doc.html

Does that help? Please let me know if you have any questions.
All the best,
Chris

Re: [Djulia] wkhtmltopdf

By Chris - September 2, 2010

Hi Djulia,

Sorry to hear you're having trouble!

I'm not sure how much we can do to help with this, but I did a little research. Someone on the [url http://code.google.com/p/wkhtmltopdf/wiki/static]wkhtmltopdf static troubleshooting page[/url] claims to have fixed their font issues by installing the a2ps package. Can you try installing that package on your server or ask your web host to install it for you?

Do any fonts show up in the output at all? You could try out the createPDF_fromUrl() function on a font test page (e.g. [url http://www.electricearl.com/fonttest.html]http://www.electricearl.com/fonttest.html[/url]) to see if some work. If some fonts work, you might be able to supply those as fallback fonts in your CSS — of course, this assumes that you are designing the content you want converted to PDF.

Please let me know how it goes or if you have any questions.
All the best,
Chris