XWIKI-11418: Custom PDF header/footer/cover get the PDF template itself as $tdoc
Fixed

(cherry picked from commit 6ad185c07ac23857ec4d7097f647d51643aa9e0f)