SuffolkLITLab / docassemble-AssemblyLine

Quickly go from a paper court form to a runnable, guided, step-by-step web application powered by Docassemble. Swap out branding and pre-built questions to meet your needs.
https://suffolklitlab.org/docassemble-AssemblyLine-documentation/
MIT License
41 stars 5 forks source link

When using the as_pdf() method of a bundle, add parameter to ensure an odd or even number of pages #837

Closed nonprofittechy closed 6 months ago

nonprofittechy commented 6 months ago

Adds a parameter ensure_parity to the ALDocumentBundle.as_pdf(), and default_parity as an attribute of the bundle.

parity means odd or even number of pages. When either parameter or attribute is set, the as_pdf() method of the bundle may pad the output with an additional page, if needed to match the desired parity.

The purpose is primarily to assist with double-sided printing.

Test document: test_bundle_parity.yml.

Example usage:

---
objects:
  - even_bundle: ALDocumentBundle.using(
          title="Even bundle",
          filename="the_bundle",
          elements=[
            the_doc
          ],
          default_parity="even",
          enabled=True
      )

Fix #828