Forum How do I...?

Onload snap() function odd behaviour

javib
I am working on a long pdf divided in several chapters chapter1.html, chapter2.html... and so on. Doing some test with the baseline snap() function I can't make it work when combining multiple html into a single PDF:

prince-books --javascript ch1.html ch2.html -o book.pdf 

Does not work
both html have:
<body onload="debug(); snap('14pt', 'img', 'height');">


if I run
prince-books --javascript ch2.html -o book.pdf 

It works without any issue and images height is adjusted, any ideas on why this happens?

Many thanks!
javib
After some tests I think it is related to the multipass function. Found on the documentation that multipass does not work when combining multiple htmls into a single book so prince needs to be called twice. Looked at the examples but I still not sure how to do this. I am working with prince-books from the command line, it is just calling the command twice? How do I link one with the other? I am not able to found examples on the documentation about this specifically. Many thanks!