Skip to content

Make PDFs additive and modular #5

@Donnype

Description

@Donnype

A nice feature would be the option to do:

import pydfy.models as pf

pdf = pf.PDF(...)
pdf2 = pf.PDF(...)

new_pdf = pdf + pdf2  # Although a more explicit pdf.merge(pdf2) makes sense to add as well
new_pdf = new_pdf.add(pf.Number(2))  # Accepting either a row or a component
new_pdf.render()  # get both PDFs merged with a PageBreak, and the Number component at the end

Because this would allow users to create larger PDFs in a modular way and pass around well-defined (ideally immutable) PDF objects. Perhaps a merge method should have an optional boolean pagebreak argument defaulting to True. Both these methods should be immutable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions