Looking at the properties for the PDFs in the Confluence Documentation Directory, I see that they're using iText:
Which is the library Confluence uses to generate PDFs.
So how do they get their PDFs to look so much better than the default?
Community moderators have prevented the ability to post new answers.
Hello Robert, I heard back from the documentation crew, please consider this regarding the PDF Export:
Confluence uses the confluence-flyingpdf plugin, which does indeed include a component that is called Flying Saucer PDF Document builder. This is bundled with Confluence. From what I can see, we are using exactly the same plugin on CAC.However what we are doing is using a PDF layout to add the title page, header and footer, and a PDF style sheet. All the info can be found on this page https://confluence.atlassian.com/display/DOC/Customising+Exports+to+PDF and I have attached the layout and stylesheet that we use.
------------------------------------------ PDF LaYOUT > PDF Space Export Title Page ------------------------------------------ <div class="fsTitlePage"> <div class="fsDocTitle">Documentation for Confluence 5.0</div> </div> <div class="tocTitle">Contents</div> --------------- PDF STYLESHEET --------------- @page { /* standard A4 paper size: 210mm wide by 297mm high */ size: 210mm 297mm; } @page :left { @top-left { content: element(header); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; } @top-right-corner { content: counter(page); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 16pt; } @bottom-left { content: element(footer); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; } } @page :right { @top-left { content: element(header); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; } @top-right-corner { content: counter(page); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 16pt; } @bottom-left { content: element(footer); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; } } @page :first { @top-left { } @top-right-corner { } @bottom-left { } } @page frontmatter { @top-left { content: element(header); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; } @top-right-corner { content: counter(page); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 16pt; } @bottom-left { content: element(footer); font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; } } .fsTitlePage { margin-left: auto; margin-top: 150mm; margin-right: auto; page-break-after:always } .fsDocTitle { font-size: 32px; margin: 36px 0 24px 0; } div.fsFrontMatter { page: frontmatter; page-break-after: always; margin-left:auto; margin-top:10mm; margin-right:auto; } div.toc { page: frontmatter; page-break-after: always; } div.tocTitle { page: frontmatter; font-size: 32px; margin: 36px 0 24px 0; page-break-after: none; } div.toclvl0:before, div.toclvl1:before, div.toclvl2:before, div.toclvl3:before, div.toclvl4:before { content: none; } body,p,li,td,table,tr,.bodytext,.stepfield { font-size: 10pt; } .header, .footer { font-family: ConfluenceInstalledFont, Helvetica, Arial, sans-serif; font-size: 10pt; font-style: italic; }
Hope this was what you were looking for!
Will the above work on Confluence 4.3.3
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Robert, Confluence uses confluence-flyingpdf-plugin. The pom.xml for this artifact can be found here.
1
2
3
|
< groupId >com.atlassian.confluence.extra</ groupId > < artifactId >confluence-flyingpdf-plugin</ artifactId > < version >2.5.6</ version > source
|
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Due to the lack of documentation and samples for getting professional-looking PDF output using the native export I'm using Scroll PDF Exporter. It's not perfect but I can work around its flaws.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Robert, it took some time because we had to reach other teams, but I have added the requested information. Hope that can stack on top of your findings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see references to Flying Saucer PDF options in the default stylesheet, so I guess Confluence uses that as well. I don't really care what's happening under the hood, my question is what tweaks is Atlassian making to the PDF stylesheet and layout to get better output than the default?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'd need to build the plugin myself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.