Control PDF generation in document package downloads

Added a generatePdf query parameter to the Download Document Package endpoint and wired it into the dashboard.

We’ve made the document package download more flexible around including an autogenerated PDF.

What changed

  • generatePdf query parameter: The download-package endpoint now accepts a generatePdf query parameter with three options: never, always, or when_no_pdf_attachment.
  • Smarter PDF inclusion: When set to when_no_pdf_attachment, the API only generates auto-generated.pdf if there isn’t already a PDF attachment on the document.
  • Dashboard behaviour: Package downloads triggered from the transmitted documents table and detail page request generatePdf=always, so the PDF is always included there.

This gives you more control over when PDFs are generated and avoids unnecessary duplicates when a document already includes its own PDF.

On this page