Fixed PDF export, closes #943