Correctly export pages as PDF (see #6317)