PDF export: add date modified
Asked by Joachim Plener:

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!

Joachim


Answers:
author: calo
body: I only know RasterEdge PDF control can [modify PDF pages](http://www.rasteredge.com/how-to/csharp-imaging/pdf-page-modify/), but I don't know whether it's what you wanted.

If you still need it, you can google it.


author: Guilherme Nedel [Atlassian]
body: 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](https://confluence.atlassian.com/display/DOC/Advanced+PDF+Export+Customisations?focusedCommentId=213516362#comment-213516362) 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):
>
> ```
> &lt;%@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,            Locale.GERMAN);    String dateString = df.format(new Date());         // create white default image    BufferedImage bufferedImage = new BufferedImage(width, height,            BufferedImage.TYPE_INT_ARGB);         // create graphic    Graphics2D dateGraphics2D = null;    try {        dateGraphics2D = bufferedImage.createGraphics();             // write string to in Black graphics        dateGraphics2D.setColor(Color.BLACK);        dateGraphics2D.setFont(new Font("Helvetica", Font.PLAIN, height));        dateGraphics2D.drawString(dateString, 0, height-2);         } finally {        // dispose graphics always        if (dateGraphics2D != null) {            dateGraphics2D.dispose();        }    }         // write output    response.setContentType("image/png");    ImageIO.write(bufferedImage, "png", response.getOutputStream()); %&gt;
> ```

comments: author: Joachim Plener
body: 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


author: Richie Hazlewood
body: 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?


author: Shell D
body: Joachim Plener - did you end up figuring out how to add the 'last modified' date to the footer?


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