Forum Bugs

requirejs support?

I'm trying to display a document that uses respect ( It doesn't seem to run any of the javascript code.

for example

prince --javascript -v -i html -o foo.pdf

Respec is a javascript library for writing w3c specs. It uses requirejs ( Requirejs in turn, appears to use setTimeout to wait for modules to load. I'm guessing that that is the source of the problem.

Any thoughts? Workarounds?
Support for setTimeout and AJAX requests will be necessary for requirejs to work. Our latest development builds of Prince support setTimeout, but AJAX is still only partially supported, so it still isn't quite enough:
prince: Running scripts...
prince: loading script:
prince: loading script:
prince: error: TypeError: invalid this value
prince: loading AJAX request:
prince: error: TypeError: invalid this value
ERROR: Error including URI=examples/minimal-w3c.html: error (TypeError: value is not an object)
Thanks. I was able to save a snapshot in the browser and convert that file instead. This way the browser javascript engine was doing all the work.
Tell them to write the spec with Bikeshed instead of ReSpec :)

I made a PDF from a W3C spec produced with Bikeshed using Prince with no issues.

Dave (who is editing specs using both Bikeshed and ReSpec)

Hi Mike

Is there a timeline for requirejs support? I see its on the roadmap but is there a chance it could be included in the next release or a patch release during 2015?

Difficult to say, we will need to investigate and see what is the major issue.
The major issue turned out to be onload events for scripts, which we now support. However, libraries such as HighCharts need many other DOM features which will take further time to develop.
Prince 11 has a number of JavaScript DOM improvements, and we now have a repository of helper scripts to boost compatibility with popular frameworks.