PDF export: Include page version number / history and date of print

Jan Orlandini June 29, 2015

Dear all,

I'd like to add the current page version number including date and time of print into the footer of the PDF export.

My page counter works just fine, but I need additional data for documentation purposes.

As far as I got through the documentation I haven't found anything about this topic. Is there a special {content: xxxxx variable for this?

Where do I put this, in HTML or CSS ?

 

Thanks in advance,

4 answers

1 accepted

2 votes
Answer accepted
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 5, 2015

Hi Jan,

great solution if you could set up your own user macro and it works!

I don't work with user macros, don't know how to use them and just wanted to give you some hints about how it could be done.

About the date conversion:

There are other topics about current date:

In the second post @Matthew J. Horn writes:

You can use the dateFormatter's formatGivenString() method to specify a format:

$action.dateFormatter.formatGivenString("dd-MMM-yyyy", $some_date)

 

 

 

 

1 vote
Jan Orlandini July 5, 2015

Dear Steffen,

thanks for your help.
However, I managed to make a workaround:

What bothers me was, that at each page the information "modified by xyz at xyz was already given, but not included in the PDF export (neither page nor space).

What I now did is, make a user macro and add on the page

## @param Title:title=Versionshinweise|type=string|desc=Title
<ac:structured-macro ac:name="panel">
        <ac:parameter ac:name="titleBGColor">#FFFFFF</ac:parameter>
        <ac:parameter ac:name="borderStyle">solid</ac:parameter>
        <ac:parameter ac:name="borderColor">#6699CC</ac:parameter>
        <ac:parameter ac:name="borderWidth">1</ac:parameter>
        <ac:parameter ac:name="titleColor">#000000</ac:parameter>
    <ac:parameter ac:name="title">Versionshinweise</ac:parameter>
    <ac:rich-text-body>Zuletzt bearbeitet von #usernameLink($content.getLastModifierName()) am $action.dateFormatter.format($content.getLastModificationDate())</ac:rich-text-body>
</ac:structured-macro>

 

By this, at the bottom of a page, the text on "modified by XXX at XXX" is generated a second time. And this one is going to be printed in PDF export!

 

However, one last bit is missing: I'd like to convert the date from currently "Jul 06, 2015" to 06.07.2015.

Can anyone give advice?

0 votes
GG December 13, 2017

With Content Exporter for Confluence addon you can add all these information like date of export, last modifier etc. to the footer. You can also format the dates to any format you like.
Check it out:
https://metainf.atlassian.net/wiki/spaces/CEX/pages/70432009/Headers+and+footers

cex_date_formatting.PNG
More info about the addon: https://marketplace.atlassian.com/plugins/com.metainf.confluence.plugin.pagetreeexporter.pagetree-word-exporter-plugin/cloud/overview 

0 votes
Steffen Heller
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 30, 2015

No, there is no variable like that and none of that is standard in Confluence.

If you want that, you must go 2 steps:

  1. Find or create a macro that generates the content for date, page version and time of print
  2. Put this content to the footer with CSS in the PDF Export Stylesheet (a combination of "content: element(xxx)" and "position: running(xxx)") 

Admittedly, that is still a long way to go.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events