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

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

Accepted Answer
2 votes

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)

 

 

 

 

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?

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.

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 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Confluence

What are your project planning tips?

Hello Community,  Jessica here from the Confluence product marketing team! Today I wanted to get your takes on project planning –– what works, what doesn’t, how do you know if you’re doing it r...

310 views 1 4
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you