PDF export: add date modified

I need the last modified date of a page to be put into the footer of every page when exporting to PDF. How can I achieve this?

Thanks in advance!


2 answers

Hi Joachim, currently that is not a feature within the application export, nevertheless some customers did report being able to add so using a bit of CSS styling - posted below, please review the comment from Gerhardt Müller for more info.

We have solved this by creating a simple jsp 'dateimage.jsp' in the confluence root dir, which creates the current date as image, and included a reference in the footer like this:

Print date: <img src="/dateimage.jsp" width="85" height="10" />

This is the jsp (for german dates, adapt as necessary):


page import="java.awt.geom.Rectangle2D"%&gt;&lt;%@

page import="java.awt.AlphaComposite"%&gt;&lt;%@

page session="false"%&gt;&lt;%@

page import="java.util.Date"%&gt;&lt;%@

page import="javax.imageio.ImageIO"%&gt;&lt;%@

page import="java.awt.Font"%&gt;&lt;%@

page import="java.awt.Color"%&gt;&lt;%@

page import="java.awt.Graphics2D"%&gt;&lt;%@

page import="java.awt.image.BufferedImage"%&gt;&lt;%@

page import="java.util.Locale"%&gt;&lt;%@

page import="java.text.DateFormat"%&gt;&lt;%@

page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%&gt;&lt;%


    // size of the image

    final int height = 100;

    final int width = 850; 


    // create string in correct date format

    DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM,


    String dateString = df.format(new Date());


    // create white default image

    BufferedImage bufferedImage = new BufferedImage(width, height,



    // create graphic

    Graphics2D dateGraphics2D = null;

    try {

        dateGraphics2D = bufferedImage.createGraphics();


        // write string to in Black graphics


        dateGraphics2D.setFont(new Font("Helvetica", Font.PLAIN, height));

        dateGraphics2D.drawString(dateString, 0, height-2);


    } finally {

        // dispose graphics always

        if (dateGraphics2D != null) {





    // write output


    ImageIO.write(bufferedImage, "png", response.getOutputStream());



Thanks for your reply! But it seems it is not exactly what we need... We do NOT need the current date in our PDF-exports, but the date, the Confluence page was LAST MODIFIED - ideally together with the author of that most recent edit. It is there - on top of every page, but in does not apear in any export-type (PDF / Word).

Another idea: Perhaps does anyone know some kind of makro, that puts this kind of information into the "printable" / exportable region of a page?

best regards, Joachim

Surely the last modified date can be piped through to the pdf exporter. Its already on the page being exported. Is this really not possible?

Joachim Plener - did you end up figuring out how to add the 'last modified' date to the footer?

Is there no easier way to include the current date into the footer for each PDF export ? 
Creating an image for a date just to put it on the footer seems to me making this problem extreme complicated.

I only know RasterEdge PDF control can modify PDF pages, but I don't know whether it's what you wanted.

If you still need it, you can google it.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

876 views 44 6
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