This question is in reference to Atlassian Documentation: Customise Exports to PDF
We just migrated to Confluence 5.8.16. Unfortunately, we experience issues with the PDF export. We have some pages where images are centered and are displayed as centered, correctly. If we export them to PDF, images will be re-aligned to the left. Does someone know, if we can rewrite this behaviour ?
Append the following code to your PDF stylesheet:
span.confluence-embedded-file-wrapper { display: inline-block !important; }
If not just images are affected, but other spans, you can embed the following:
p[style="text-align: center;"] span, p[style="text-align: right;"] span { display: inline-block !important; }
The actual issue is about the <span> tag that wraps the image. After centering an image with the editor, you have a construct like
<p style="text-align: center;"><span class="confluence-embedded-file-wrapper confluence-embedded-manual-size"><img class="confluence-embedded-image" src="/xsystem/download/attachments/344041801/Koala.jpg?version=1&amp;modificationDate=1448543356520&amp;api=v2" data-image-src="/xsystem/download/attachments/344041801/Koala.jpg?version=1&amp;modificationDate=1448543356520&amp;api=v2" data-unresolved-comment-count="0" data-linked-resource-id="382009443" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="Koala.jpg" data-base-url="https;//*/xsystem" data-linked-resource-content-type="image/jpeg" data-linked-resource-container-id="344041801" data-linked-resource-container-version="15" height="250"></span></p>
The style 'text-align:center' will not be applied to the <img> tag due to the span tag which has this missing property: "display:inline-block;"
@Atlassian: Please provide this fix in an upcoming version!
Hi @Jens Kasperek (Bosch GmbH),
I used Content Exporter addon (available in Cloud too) to export a test page and the alignment seems to be correct in PDF (see the attached picture)
BR: Attila
2016-02-06_10h31_31.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is complicated.
Centering elements can be achieved with numerous methods. Search for "css image center" to see how many hints and tricks exist.
If your images are centered in the wiki page but not in the PDF you would have to examine
In the end you have to define your own customized CSS that
To answer your question: Yes, you can rewrite this behaviour but it can take a while.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Want to leave your mark on Confluence? One winner will have their whiteboard design added into Confluence for all users to access! This is your chance to showcase your creativity, help others, and gain recognition in the Confluence community.
Share your template today!Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.