Hi everyone,
The PDF Export Application has a configuration option to limit the size of the PDF export:
# [Since 14.10]
# The maximum content size, in kilobytes (KB), an user is allowed to export to PDF; in order to compute the content size
# we sum the size of the HTML rendering for each of the XWiki documents included in the export; the size of external
# resources, such as images, style sheets, JavaScript code is not taken into account; 0 means no limit;
export.pdf.maxContentSize=100
This configuration is exposed in the dedicated administration section. The reasons for which we introduced this configurable limit are:
- XWiki supports multi-page PDF export, meaning that any user can trigger a large export (e.g. of tens or hundreds of pages)
- even if the selected pages are rendered in a background (daemon) thread with low priority, we need to keep their XDOM (see Loading...) in order to compute the aggregated Table of Contents, which can end up taking a lot of memory
I got reports from users complaining they get:
Failed to export as PDF. RuntimeException: Maximum content size limit exceeded
which shows that the default value for this limit is not right. I will improve the message to indicate that the limit can be increased or disabled from the administration, but we need to decide on the default value. I see two options:
- No limit by default, i.e. set the limit to 0 (proposed by @lucaa )
- Increase the limit, from 100KB to 1MB
WDYT?
On my side I don’t have a strong opinion, so +0 for either of them.
Thanks,
Marius