PDF Export fails to properly render for a specific page in Chromium based browser

Hello,

I need some help troubleshooting an issue I have in XWiki 16.10.15. There is a page with a table which I can export to PDF with Firefox without any issues. However, in Edge and Chrome only the table headers are rendered while the table content is missing. Aside from that, the last exported page is completely missing PDF header and footer. I’ve tested several other pages that include tables, but I’ve only noticed the issue with this specific page.

I compared Web Console output between Chrome and Firefox, and noticed one extra error in Chrome “Layout repeated at:” referencing “VM2637 paged.polyfill.js”. This seems to be the only relevant difference between Firefox and Chromium browsers.

I haven’t been able to find any related issue, and would like to further investigate, but I don’t know where else to look.

1 Like

Some further information. I have a custom PDF template. With the default one, the PDF renders properly. The error in the console leads to this:

if (breakToken) {
let newToken = breakToken.toJSON(true);
if (tokens.lastIndexOf(newToken) > -1) {
// loop
let err = new OverflowContentError(“Layout repeated”, \[breakToken.node\]);
console.error("Layout repeated at: ", breakToken.node);
return err;
}

I don’t understand why only Chromium browsers are affected.

Edit:
removed margin changes from the body class, works now. Still don’t understand why Chromium browsers throw out errors.

Hi,

Does your table use rowspan or colspan by any chance? We fixed (workaround) this issue recently Loading... (in 16.10.16).

Thanks,
Marius

Hi,

no, it’s just a regular WYSIWYG table, looks like this:

|(% style="color:#b22222; width:675px" %)**TO-DO**|=(% style="width: 841px;" %)(% style="color:#daa520" %)Done
|(% style="width:675px" %)(((
(((

It’s only this specific page, it seems like. Other pages with tables are exported correctly.

I had to remove this from my PDF template:

[data-id="body"], [data-id="xwikimaincontainer"], [data-id="xwikimaincontainerinner"], [data-id="xwikicontent"], [data-id="mainContentArea"] {
  margin-top: 40px !important;
}

I did notice that if I make the browser window narrower, I get a different (but still broken) result.