PDF export: Include page version number / history and date of print
Asked by Jan Orlandini:

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,


Answers:
author: Steffen Heller
body: 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:

* [Current date macro in confluence?](https://answers.atlassian.com/questions/86518/current-date-macro-in-confluence)

* [How do you display current date and time in Confluence using User Macro and how do you add it like a date and time stamp.](https://answers.atlassian.com/questions/266126/how-do-you-display-current-date-and-time-in-confluence-using-user-macro-and-how-do-you-add-it-like-a-date-and-time-stamp.)

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)


author: Jan Orlandini
body: 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&lt;ac:structured-macro ac:name="panel"&gt;        &lt;ac:parameter ac:name="titleBGColor"&gt;#FFFFFF&lt;/ac:parameter&gt;        &lt;ac:parameter ac:name="borderStyle"&gt;solid&lt;/ac:parameter&gt;        &lt;ac:parameter ac:name="borderColor"&gt;#6699CC&lt;/ac:parameter&gt;        &lt;ac:parameter ac:name="borderWidth"&gt;1&lt;/ac:parameter&gt;        &lt;ac:parameter ac:name="titleColor"&gt;#000000&lt;/ac:parameter&gt;    &lt;ac:parameter ac:name="title"&gt;Versionshinweise&lt;/ac:parameter&gt;    &lt;ac:rich-text-body&gt;Zuletzt bearbeitet von #usernameLink($content.getLastModifierName()) am $action.dateFormatter.format($content.getLastModificationDate())&lt;/ac:rich-text-body&gt;&lt;/ac:structured-macro&gt;
```

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?


author: GG
body: 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](https://community.atlassian.com/t5/image/serverpage/image-id/10943iDF1420C17226941D/image-dimensions/363x168?v=v2 "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](https://marketplace.atlassian.com/plugins/com.metainf.confluence.plugin.pagetreeexporter.pagetree-word-exporter-plugin/cloud/overview?)


author: Steffen Heller
body: 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.


Tags: confluence-administration