-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Component/s: Page - Export - PDF, Space - Export - PDF
-
None
-
Minor
Issue Summary
In Confluence Cloud, when customising the PDF Export Header, the PDF export engine fails to resolve image attachments if the filename contains spaces (%20), or other special characters that require URL encoding. While images with simple alphanumeric filenames (e.g., image.png) render correctly, filenames like test%20image.png or Test%20123%20image.png result in a broken image icon in the generated PDF.
Steps to Reproduce
- Go to a Confluence page and attach two images to a page:
- Image A: header.png
- Image B: test image.png (Note the space in the name).
- Navigate to Space Settings > Look and Feel > PDF Export.
- In the Header section, add the HTML (see below example) using the Page ID where the images are attached.
- Perform a Space or Page Export to PDF.
- Open the resulting PDF and observe the header.
<!-- This image will work --> <img src="https://site.atlassian.net/wiki/download/attachments/PAGE_ID/header.png?api=v2"> <!-- This image will fail --> <img src="https://site.atlassian.net/wiki/download/attachments/PAGE_ID/test%20image.png?api=v2">
Expected Results
Both images should render correctly in the PDF header, as the PDF engine should be able to resolve URL-encoded paths for internal attachments.
Actual Results
Only the image with the simple filename (header.png) renders. The image with the encoded space (test%20image.png) fails to display, even though the URL is technically correct and accessible via a browser.
Workaround
- Rename the Attachment: Rename the image file within Confluence to remove all spaces, dashes, or special characters before referencing it in the PDF Layout.
- Base64 Encoding: Convert the image to a Base64 string and embed it directly into the src attribute (e.g., src="data:image/png;base64,..."), which removes the dependency on URL path resolution.