Relative attachment URLs in custom PDF stylesheets are not rendered after upgrading to Confluence 10.2

XMLWordPrintable

    • 2
    • Severity 3 - Minor
    • 22

      Issue Summary

      Images referenced by relative attachment URLs in a custom PDF stylesheet are not rendered in Confluence Data Center 10.2.14.

      Example relative URL:

      background-image: url('/download/attachments/<content-id>/<filename>'); 

      The equivalent absolute URL renders correctly:

      background-image: url('https://<base-url>/download/attachments/<content-id>/<filename>'); 

      A data-URL also renders correctly.

      Steps to Reproduce

      1. Create a Confluence space and page.
      2. Attach a valid PNG file named pdf-test.png to the page.
      3. Record the attachment download URL.
      4. Configure this minimal space PDF stylesheet (replace URL with real attachment):
      body {
          padding-top: 150px;
          color: #ff0000 !important;
          font-size: 24px !important;
          background-image:
              url('/download/attachments/<content-id>/pdf-test.png');
          background-repeat: no-repeat;
          background-position: left top;
      } 

       6.  Perform a space PDF export or PDF export a single page in that space

      Expected Results

      The root-relative attachment URL should resolve to the same Confluence attachment as the equivalent same-base absolute URL.
      Both of these forms should render the image:

      url('/download/attachments/<content-id>/pdf-test.png')`
      url('https://<base-url>/download/attachments/<content-id>/pdf-test.png') 

      Actual Results

      Only the absolute images render in exported PDF

      Workaround

      Use absolute URLs in PDF stylesheets

              Assignee:
              Unassigned
              Reporter:
              Pille Saral
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: