Using XSLTProcessor with wkhtmltopdf

469 views
Skip to first unread message

Anthony DELEYE

unread,
Jun 5, 2014, 3:34:44 AM6/5/14
to wkhtmltop...@googlegroups.com
Hi,

I'm trying to print a pdf thanks to wkhtmltopdf of a HTML. My HTML transforms a XML with a list of XSL. It's working fine with IE or Mozilla Firefox. But I can't transform my XML with wkhtmltopdf because my Javascript is stopping when using the XSLTProcessor constructor.

Does anyone know how to use XSLTProcessor in the version 0.12.1.0 of wkhtmltopdf ?

Thanks,

Anthony

Ashish Kulkarni

unread,
Jun 5, 2014, 5:48:40 AM6/5/14
to wkhtmltop...@googlegroups.com
I don't think that XSLT is enabled in QtWebKit (the browser engine
that powers wkhtmltopdf) -- see
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1509 for something
else which also broke due to this.

Joe Rennemeyer

unread,
Jul 28, 2014, 10:26:46 PM7/28/14
to wkhtmltop...@googlegroups.com
How does it handle passing an XSLT for the TOC then? I suppose that's bypassing QtWebKit since it doesn't actually read from an html source. I was hoping I could pass an XML file with XSLT as a source file and have the rendered output captured in the PDF, but it's ignoring the XSLT completely.

mn4367

unread,
Aug 1, 2014, 5:38:04 PM8/1/14
to wkhtmltop...@googlegroups.com
This is done in a different code path. If you use a custom XSLT for the ToC the transformation is is done by wkhtmltopdf by using a framework of Qt (Qt XML Patterns). This transformation creates an HTML (at least it should do) which is then used to render the ToC. This is done completely outside of QtWebKit. So behind the scenes two documents are created and then rendered, first the ToC and then the document(s) from the commandline.

Joe Rennemeyer

unread,
Aug 1, 2014, 6:22:47 PM8/1/14
to wkhtmltop...@googlegroups.com, wkhtmltop...@googlegroups.com
Thanks for the reply. What I'm looking for is to pass my own XML and xslt to that same process to generate an HTML to be rendered into PDF. Since you're adjust doing that using your TOC I was hoping it'd be easy to extend to a provided XML.


--
===================================================
You received this message because you are subscribed to the "wkhtmltopdf General" group.
To post to this group, send email to wkhtmltop...@googlegroups.com
To unsubscribe from this group, send email to wkhtmltopdf-gen...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/wkhtmltopdf-general?hl=en?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "wkhtmltopdf General" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wkhtmltopdf-general/97ZqhLYt8sU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wkhtmltopdf-gen...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mn4367

unread,
Aug 1, 2014, 6:28:46 PM8/1/14
to wkhtmltop...@googlegroups.com
With a small script this should be possible with xsltproc. On most Unix systems (including OS X) it should be installed already, for Windows precompiled binaries are also available.
Reply all
Reply to author
Forward
0 new messages