When calling .text with either an empty string, blank string or a non-matched string (like "???") the extra width calculation will fail because words.length is not possible on a null value.
On the regexp match use the text in an array as default.
This way the text will still be added to the pdf.
When matching text have an array with the text as default
Dirty fix for setting height in pdf.text
JS ONLY! Fix for recursive image handling
Should be fixed by recent changes.