PDF whitespace tweaks

A few changes to the layout in exported PDFs to make (hopefully) better use of available whitespace.

Also changes the way the used space estimates are calculated so that heading sizes etc are taken into account. Still not very accurate (e.g. it doesn't know about line breaks for long unbroken strings), but should hopefully give a decent indication within 5%.