This issue has been created
There are 10 updates.
 
 
XWiki Platform / cid:jira-generated-image-avatar-1c3b2afe-a5fb-4460-84b6-571ef7dae3cd XWIKI-23346 Open

PDF export using Chrome times out if the content has a lazy loaded image with specified dimension on the second or any of the following print pages

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-488d9ece-3d95-4e57-b84f-76e4a415f6c3 Marius Dumitru Florea created this issue on 26/Jun/25 20:31
 
Summary: PDF export using Chrome times out if the content has a lazy loaded image with specified dimention on the second or any of the following print pages
Issue Type: cid:jira-generated-image-avatar-1c3b2afe-a5fb-4460-84b6-571ef7dae3cd Bug
Affects Versions: 16.4.6
Assignee: Unassigned
Components: Export - PDF
Created: 26/Jun/25 20:31
Environment: Chrome
Priority: cid:jira-generated-image-static-major-f4e49820-65ca-4fad-b2c7-c7fd198c9f03 Major
Reporter: Marius Dumitru Florea
Description:

Steps to reproduce:

  • create a wiki page with this content:
    first page
    
    (% class="break-before-page" %)
    second [[image:Sandbox.WebHome@XWikiLogo.png||loading="lazy" width="16"]] page
    
  • add a stylesheet extension with this content:
    .break-before-page {
      break-before: page;
    }
    
  • mark the added SSX as loaded "On this page or on demand".
  • export the created wiki page to PDF using Chrome (either your own browser or a headless instance)

Expected: the page is exported to PDF
Actual: the PDF export times out

Notes:

  • the stylesheet is needed just to simulate multiple print pages
  • the following conditions are all required to reproduce the issue:
    • use Chrome
    • the image has to be on the second or any of the following print pages
    • the image has to be lazy loaded
    • the image dimention has to be specified (width or height or both)

Explanation:

  • HTML images support the loading attribute whose "lazy" value tells the browser to defer the image loading until the image is scrolled into view. This means that such images will have the complete property set to false until the image gets into view port. And of course the load event is not going to be fired sooner than that.
  • when a wiki page is exported to PDF, paged.js, the library we used to split the content into print pages, has to wait for images to be loaded in order to know if they fit the current print page or have to be moved to the next print page.
  • Chrome doesn't fire the load event for lazy loaded images with specified dimensions until they are scrolled into view
  • if such an image is not on the first print page then the load event is never fired (the image is not loaded) so paged.js waits until the timeout is reached.
 
 

10 updates

 
cid:jira-generated-image-avatar-488d9ece-3d95-4e57-b84f-76e4a415f6c3 Changes by Marius Dumitru Florea on 26/Jun/25 20:31
 
Summary: PDF export using Chrome times out if the content has a lazy loaded image with specified dimention dimension on the second or any of the following print pages
Fix Version: 16.10.9
Fix Version: 17.5.0
Fix Version: 17.4.2
Development Priority: High
Difficulty: Unknown Medium
Documentation: N/A
Documentation in Release Notes: N/A
Assignee: Marius Dumitru Florea
Tests: Integration