XWiki Platform
  1. XWiki Platform
  2. XWIKI-9606

Scaled image attachments don't appear in the PDF export

    Details

    • Tests:
      Unit
    • Development Priority:
      High
    • Difficulty:
      Easy
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Create a page and add link for an image inside the content:

      [[image:logo.png||width="200"]]
      

      The URL for the image will be displayed correctly when using the xpage=pdf option, while inside the PDF export the image will be missing.

        Issue Links

          Activity

          Hide
          Vincent Massol added a comment -

          Note that Oana told me that it worked fine in 4.5.3. Thus I'm marking this issue as a regression and blocker.

          Show
          Vincent Massol added a comment - Note that Oana told me that it worked fine in 4.5.3. Thus I'm marking this issue as a regression and blocker.
          Hide
          Vincent Massol added a comment -

          Marius, any idea when you can fix it (you're assigned to it), I think we need to have it in 5.2.1 since it's a regression. Thanks.

          Show
          Vincent Massol added a comment - Marius, any idea when you can fix it (you're assigned to it), I think we need to have it in 5.2.1 since it's a regression. Thanks.
          Hide
          Marius Dumitru Florea added a comment -

          The problem was that XWikiWikiModel was modifying the attachment URL after creating it with the URL factory. XWikiWikiModel needs to add some query string parameters in case the image dimensions are specified in order for the image attachment to be resized on the server side.

          At the same time, when a page is exported to PDF a special URL factory is used which builds a map of (URL, AttachmentReference). This map is then used by a custom FOP URI resolver to embed the images in the PDF document. Obviously if we modify the URL after calling the URL factory (in order to extend the query string) then the FOP will ask the resolver to resolve an URI that doesn't have an entry in the (URL, AttachmentReference) map build by the URL factory.

          Show
          Marius Dumitru Florea added a comment - The problem was that XWikiWikiModel was modifying the attachment URL after creating it with the URL factory. XWikiWikiModel needs to add some query string parameters in case the image dimensions are specified in order for the image attachment to be resized on the server side. At the same time, when a page is exported to PDF a special URL factory is used which builds a map of (URL, AttachmentReference) . This map is then used by a custom FOP URI resolver to embed the images in the PDF document. Obviously if we modify the URL after calling the URL factory (in order to extend the query string) then the FOP will ask the resolver to resolve an URI that doesn't have an entry in the (URL, AttachmentReference) map build by the URL factory.

            People

            • Assignee:
              Marius Dumitru Florea
              Reporter:
              Elena-Oana Tabaranu
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: