pdfme / pdfme

A TypeScript based PDF generator library, made with React.
https://pdfme.com
MIT License
2.16k stars 192 forks source link

Dynamic text with unknown length should add new pages accordingly while generating the PDF #437

Open vpn-dev opened 2 months ago

vpn-dev commented 2 months ago

Describe the bug

I want to add some agreements kind of text which i need to add at last of the pdf which is completely dynamic. Currently I am doing something like {{agreements}} in text widget which while generating the pdf on server not working when text is too large . Ideally pdf should add pages according to content length

To Reproduce

Described in detail in bug description

Expected behavior

Described in detail in bug description

Your Environment

- pdfme package(@pdfme/generator or @pdfme/ui): latest
- pdfme version: latest
- Operating system: Linux
- Node.js version or Browser name & version: node 18

Your Error Log

No errors

Additional context

No response

hand-dot commented 2 months ago

Hey @vpn-dev ! Thank you for the suggestion.

I also have been wanting this feature. I'm thinking of incorporating something like a template engine that can handle placeholders.

In the tables we are currently implementing, we have added a mechanism that allows dynamic height changes and, if necessary, page breaks, so I think it might be possible to realize this using that mechanism.

It might take some time, but I would be happy to discuss the specifications and how to implement it here.


ref: https://github.com/pdfme/pdfme/pull/388 ref: https://github.com/pdfme/pdfme/discussions/208#discussioncomment-6594913 ref: https://support.pdfgeneratorapi.com/en/category/expression-language-q203pa/