PDF template: don't duplicate code