You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I'm trying to figure out a way to pull the page title, just the first 5 characters of the page title, date (included as a macro on the page), and the status of the page and include it in the header during PDF Export.
I have written the following HTML in the header section to get this:
<table>
<tr>
<td style="color: #663399;"><b>Company Name</b></td>
<td><b>First 5 characters of Page Title</b></td>
<td><b>Date Macro from Page</b></td>
<td><b>Page Status</b></td>
</tr>
<tr>
<td colspan="4">Page Title</td>
</tr>
</table>
I've just hard-coded the information, but I would like to have the pdf export inherit this information from the page, so that I do not need to modify the HTML every time I export a pdf.
Has anyone been able to do something similar?
One approach to dynamically generate a PDF header that includes the page title, date, and page status without hard-coding the information is to use a third-party add-on such as Scroll PDF Exporter or k15t's PDF Exporter.
These add-ons allow customization of the PDF export template and include dynamic content such as page titles, dates, and macros. Alternatively, you can use Confluence's built-in PDF export template feature, which allows you to create a custom PDF export template using HTML and CSS, which can include dynamic content using Confluence's template variables.
You can then upload this template to Confluence's template library and select it when exporting a page to PDF.
Thank you! I'm using Confluence's built-in PDF export, but I didn't realize you could make a template with variables. I just did that for the variables I need, but how do you go about calling them in the Header HTML (or CSS stylesheet)? Is there a specific naming convention to pull those variables?
Like if my template variable was a text variable called page_stat, how would I incorporate it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.