PDF Export issue with file permissions

Hi,

I’m really not up to date with how PDF export/FOP works, but if you really want to go the way of trying to change the default FOP cache location, maybe this can help:

As far as I can see, we do have a “default” configuration file (provided inside xwiki-platform-oldcore-*.jar) which then also gets extended with some font configuration auto-detection performed by XWiki.

This is the current content of the file xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/fop-config.xml at master · xwiki/xwiki-platform · GitHub and you can make your changes by dropping your modified version of this config file in tomcat/webapps/xwiki/WEB-INF/classes/fop-config.xml and probably restarting xwiki (tomcat, to be more precise).

For future reference, if I read well, the FOP configuration loading seems to be handled around these lines xwiki-platform/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/internal/pdf/FOPXSLFORenderer.java at master · xwiki/xwiki-platform · GitHub

Additional configuration options on the Apache FOP website: Apache(tm) FOP: Configuration

Additional details on how to customize PDF exports (and maybe understand better how XWiki uses FOP, if needed): https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Configuration/#HCustomizingthePDFexportLook26Feel

Regarding your actual issue, it sounds more like a configuration problem that not that many users face and that is not really specific to XWiki (as previously stated). However, please report back if you succeed in setting a custom cache location, as it may be an option for XWiki to try to force a cache location (if not already specified in the config) to a folder that is writable (either temp folder or permanent directory), similarly to how the FOP configuration is extended with font locations, to try as much as possible to avoid this problem from surfacing.