My custom PDF templates aren't listed anymore when exporting to PDF

XWiki 14.10.18

I’m working on a custom PDF template since a few days. And I succesfully used it in a few pages.

Today I discovered that when exporting a page to PDF my custom template isn’t listed anymore in the export window.
I did some operations on that template, including moving it to a new path, messing up its path (I managed to enter a “/” in a page name, while on Tomcat…), so I created a brand new template, saving it as it is proposed, without any extra change.

But even this new template does not appear in the export window, where only the Default template is listed.

I already tried refreshing the page I want to export and even restarted the instance.
What should I check to diagnose this situation? Tomcat catalina.out file shows no errors.

I found a table under /xwiki/bin/view/XWiki/PDFExport/TemplateClass and my templates are listed there.
Plus, comparing the contents of the object editor of my custom template page vs. the Default template page I can see the XWiki.PDFExport.TemplateClass object in both.

Nevermind, I forgot that after having created a new template, it must be explicitly configured in the wiki administration (from: PDF Export Application extension):

The “PDF Export Options” modal allows you to:

  • Select the PDF template to use. The list of PDF templates you can choose from is configured in the dedicated administration section.
  • […]

Maybe I spotted a small bug though: if a template is renamed or repositioned inside the wiki, that configuration isn’t updated and the template disappears from the export window drop down list.

Yes, this is indeed the current behavior. It’s a common issue when document references are saved as property values (not necessarily for configuration).

1 Like