Background images on PDF do not render correctly when using PDF macro
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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
Summary
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.
Solution
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
:
1
2
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 CONFSERVER-33763 - Large embedded images are not displayed within pdf macro for more information or to leave comments.
Was this helpful?