pdf-export macro

Overview

This macro is only functional when K15t Scroll PDF Exporter is installed.

The pdf-export macro is used to export a page or blog post in PDF format and add the PDF to the page as an attachment.

The macro adds a pdf export file to the page with the following name format

  • <confluence_filename>_<document_version>_<date_pdf_file_created>_<time_pdf_created>.pdf

When using with K15t Scroll PDF Exporter, a parameter can be added to specify a PDF template to be used for the export. This parameter value will be a K15t Template Name or K15t Template ID value sourced from the K15t Scroll PDF Exporter app template information.

For more information

Requirements

You must install the K15t Scroll PDF Exporter app to use this macro.

If you want to export only content that is in a Comala workflow final state, then you must install the Comala Document Management for Scroll Exporter app (it is free, but it can only be installed after K15t Scroll PDF Exporter and Comala Document Management have been installed).

The pdf-export macro is only supported if used with Scroll PDF Exporter 4.10.11 or higher

Where to use it?

Optional

The pdf-export macro can be put in a trigger macro.

The pdf-export macro will first check for an active installation of K15t Scroll Exporter.

Parameters

Parameter

Required

Default

Notes

Parameter

Required

Default

Notes

template

No*

Blank

Parameter to specify a PDF template to be used for the export

  • if the template parameter is not specified, the bundled 'Documentation' template is used

Value can be one of:

  • Template Name

  • Template ID

K15t recommend this parameter value to be added as the template id. The template ID is found in the K15t Scroll PDF Exporter dashboard.

If the specified template is not recognized, the exported PDF uses the bundled 'Documentation' template (the default template).

Setting a template when the macro is used with K15t Scroll Exporter

To specify a template to use for export, use the template name in the pdf-export macro as shown.

{pdf-export:template=Article}

You can find the value of the template ID by accessing the K15t Scroll PDF Exporter dashboard

  • Space Tools > Apps > Scroll PDF Exporter

  • Global Admin > Scroll PDF Exporter > Templates

  • find the template you want to use (or create a new template)

  • choose Template Information from the template ellipsis dropdown menu

  • copy template ID from the K15t app popup template information

  • add to the pdf-export macro in the workflow trigger macro

If you have created or downloaded a new PDF template in the K15t PDF Exporter app, the template id will be in a slightly different format than the K15t app-supplied templates.

Copy the hexadecimal template id from the Template Information.

Paste the template id into the pdf-export macro in the trigger.

{pdf-export:template=4e0e8c19-67ac-4f3e-864e-1090d5ae0556}

Basic example

{workflow:name=Export PDF on Approval} {state:Editing|submit=Review} {state} {state:Review|approved=Approved|rejected=Editing} {approval:Review} {state} {state:Approved|updated=Editing|final=true} {state} {trigger:statechanged|state=Approved} {pdf-export} {trigger} {workflow}

The state changed event for the transition to the Approved state will add a PDF export of the current content as a file attachment to the current page. If no template name of id is specified, the K15t PDF Exporter app uses the default template.

  • each occurrence adds a further PDF export attachment

The exported PDF filename, by default, is generated as

  • the content filename

  • the Confluence content version at the time of the export

  • and the date and time of the export.

The K15t admin can change the export filename structure.

If the K15t app is unable to recognize a template id or name

  • PDF export still occurs, but the default template will be used

  • an on-screen message confirms the use of the default PDF export template

Events

The following events are associated with pdf-export

  • pdf-export-success

  • pdf-export-error

Example

See Also

K15t Scroll PDF Exporter Atlassian Marketplace links

Related Comala Document Management documentation links