fix printing multi page documents from HTML
merge from Branch lp:~tpokorra/openpetraorg/dev0002637 (backport!)
This is a fix for printing multi page documents from HTML.