Hello everyone,
I need to export a couple of pages in Confluence to PDF to serve as project documentation.
For this I wanted to add the title of the page to the header of the export.
I found (and tried) this CSS code in the PDF stylesheet in order to achieve this:
@top-left {
content: element(runningheader);
}
...
.pagetitle h1 {
position: running(runningheader);
font-size: 6pt;
}
However, I am facing two problems:
Does anyone have a solution for this?
Thanks in advance!
In case someone else needs this:
I found two possible solutions now:
1) use h1:first-child instead of .pagetitle h1:
h1:first-child {
position: running(runningheader);
}
This only moves the title to the header, the other h1 headings stay where they should be
2) Create a user macro that displays the page title and use CSS to move that content to the header. For this to work every page you want to export with the title in the header needs to have the specified macro in it of course.
User macro:
## @noparams
<div class="pageTitleHeader" style="display:none">
$content.title
</div>
CSS:
.pageTitleHeader{
display: block !important;
position: running(runningheader);
}
The advantage of this solution is that you will still have the title printed in a large font on the first page and have it in the header at the same time.
Probably not the best way to do it but at least it seems to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.