calibre uses a webkit browser engine to convert to pdf. So you should be able to use whatever javascript you like. However, using XML preprocessor directives is probably what causes the problems, as calibre will strip these in the conversion process, before they reach the WebKit engine. Try to replace them with normal tags.
|