Forum How do I...?

JS-generated syntax highlighting doesn't show up in PDF

vitaly.friedman
Hello,

i am trying to include syntax highlighted code snippets into a Prince-generated PDF, however, Prince doesn't seem to work with a well-respected and popular Syntax Highlighter Prism.js (http://www.prismjs.com). If I activate JavaScript using "--javascript" in the command line and use a default development version of the highlighter

/Users/ebooks/Prince/lib/prince/bin/prince --disallow-modify "/Users/ebooks/Production/PDF/source.html" -s "/Users/ebooks/Production/PDF/css/pdf.css" -o "/Users/ebooks/Production/PDF/ebook.pdf" --javascript

An error occurs:

prince: /Users/ebooks/Production/PDF/js/prism.js:429: error: unexpected token punctuator("}")
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object
prince: error: TypeError: value is not an object

Could you please look into it?
mikeday
This should work in the next release of Prince, along with other JavaScript pretty-printing libraries like prettify and HighlightJS.
vitaly.friedman
Fantastic! When should we expect the new version of Prince? Thank you!
mikeday
Not for a while, but we're planning to release a test version in March that should include most of the JavaScript improvements.
vitaly.friedman
Great, thanks for the feedback!