Background images on PDF do not render correctly when using PDF macro
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Workaround listed on this page is valid only for confluence versions 5.3-5.8. If your version is outside of this version workaround won't help.
Problem
After inserting a PDF into a Page in Confluence, parts of the PDF image do not render. In this example there should be a background image but instead it is just dark gray:
The following appears in the atlassian-confluence.log
:
WARN [http-bio-5553-exec-4] [com.benryan.conversion.PPTSlideServlet] doGet Conversion task timed out for attachment : File_Name.pdf with page number 0,
waited : 300, now executing in background.
Workaround
Disabling this memory guard can cause OutOutMemoryErrors if a high resolution image is embedded in a PDF.
- Open <confluence_install>/bin/setenv.sh in the editor of your choice
- Find the line that starts with JAVA_OPTS=
- For example, the line may look like JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m $JAVA_OPTS -Djava.awt.headless=true "
- Add the following to the end of the line: -Dpdf.render.memory.guard.disabled=true
- For example, the line will now be: JAVA_OPTS="-Xms1024m -Xmx1024m -XX:MaxPermSize=512m $JAVA_OPTS -Djava.awt.headless=true -Dpdf.render.memory.guard.disabled=true "
- Save the setting.sh file.
- Restart confluence
- Navigate to the page with the PDF attached to it, remove the embedded PDF macro and delete the attachment (or you could simply delete the page and recreate)
- Re-attach the PDF
Resolution
Currently unresolved, see - CONF-33763Getting issue details... STATUS for more information or to leave comments.