How to export space to PDF with date time
Asked by Rafael Fernandez Coelho:

Hello!

I am trying to export some pages to PDF with date and time of the export.

I was able to export a page tree (I don't know if it's the name in english, but I'm refering to a page with all of it's child pages) using the export in space settings, but I'm unable to find a way to add the date and time of export.

Currently I'm trying to adjust the footer in the export PDF settings (<https://support.atlassian.com/confluence-cloud/docs/customize-exports-to-pdf/>) using JS but it was not mentioned in the doc so I don't know if it's supported (it was a Bing suggestion and as I don't know a lot about it I decided to try ... obviously no luck so far)

I searched here but was unable to find anything about it ? (at least nothing native without using apps)

Thanks!!

Rafa Coelho


Answers:
author: Rafael Fernandez Coelho
body: Hello!

I just asked the support about it and I'll share their answer - in case someone end up here while searching for something like this

I tried copying their message but got some errors here while trying to post, so in summary: there isn't a feature for that, at least for now, and he sent me link of two suggestions

<https://jira.atlassian.com/browse/CONFCLOUD-55765>

<https://jira.atlassian.com/browse/CONFCLOUD-16733>

Also, he suggested using third-party apps, like this [https://marketplace.atlassian.com/apps/7019/scroll-pdf-exporter-for-confluence?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/7019/scroll-pdf-exporter-for-confluence?hosting=cloud&tab=overview)


author: Barbara Szczesniak
body: [@Rafael Fernandez Coelho](/t5/user/viewprofilepage/user-id/3842901) Those PDF Settings look similar to the **Space Settings \> Look and feel \> Page layout**. If you look there, it says you can use wiki markup to add text, links, macros, and images. Looking at the help there, it doesn't mention how to add a date, but maybe you (or someone else) knows what markup to use to get the current date.

comments: author: Rafael Fernandez Coelho
body: Hey [@Barbara Szczesniak](/t5/user/viewprofilepage/user-id/5187859) thanks for the idea

I didn't look there previously, I was focusing on the PDF export settings only, but it would work for us - however for what I found while searching, and also asking AI, aparently there is no direct markup that could get current date

And in the PDF settings only HTML+CSS is supported, at least that is what I understood from the documentation and it does not mention if JS is supported somewhow. The only piece of code that I was able to find depends on JS

*** ** * ** ***

\<p\>text 1\</p\>

\<p id="datetime"\>\</p\>

\<p\>text 2\</p\>

\<script\>

var now = new Date();

var datetime = now.toLocaleString();

document.getElementById("datetime").innerHTML = datetime;

\</script\>

*** ** * ** ***

If you know some workaround to add the current date to the page itself without being the date macro it could help us - but for what I found while searching it's only possible using apps or on server

Thanks again!


author: Barbara Szczesniak
body: I have the full version of Acrobat, so I find it easier to add the date in the footer once the PDF is created. Of course, I only needed to make my first PDF yesterday. (and then today, the people I made it for asked for a Word version)


Tags: cloud

confluence-cloud

export