Skip to content

justunsix/confluence-export-pages-to-pdf

Repository files navigation

Export Confluence page(s) to PDF

Gitpod ready-to-code

Why use?

Advantages

  • Uses an automated web based login to Confluence on a headless browser to export a PDF using Confluence's own PDF export.
  • Does not require Confluence API to be turned on to export files.
  • Script can be changed to do any manual steps you can do in a browser (e.g. export to other formats, make changes).

Disadvantages

  • Script is an automated specific case and is not ideal to configurations or accepting parameters. For configurations, use the Confluence API or CLI.

Web Automation Option

Node.JS Puppeteer Option

Set up

Install Node 10.18.1+ or later

npm install
cp config/default.yaml config/local.yaml

Edit local.yaml with your Confluence username, password, and URL for the export setting in your space.

Run

node index.js

Appendix: Original project setup

  1. Record use case in Chrome recorder
  2. Install Puppeteer which will include a recent version of Chromium npm i puppeteer
  3. Install config to manage configuration files npm install config
  4. Install js-yaml to parse yaml configuration npm i js-yaml

References Used for Building this Repository and Researching Options

Web Testing Approach

About

Export Confluence page(s) to PDF

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published