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.