cooltronicpl / Craft-document-helpers

Craft CMS 3 and 4, 5 alpha, beta plugin enabling PDF document generation from template Twig files, code blocks and URLs
Other
12 stars 6 forks source link

pdfAsset with extra custom asset field #21

Closed masiorama closed 10 months ago

masiorama commented 10 months ago

Hello, thanks for your plugin. I have a question: is it possible to generate pdf as assets with pdfAsset passing also custom fields? For instance, my pdf volume has also another custom field catalogPdfType that is useful for me to get also the type of the asset once I want to read the asset, because with the same generation process I have to create 3 different files which have slight differences.

asset

I read the entire doc and I wasn't able to find any suggestion. Thanks in advance!

masiorama commented 10 months ago

I guess something should be done around here.

cooltronicpl commented 10 months ago

So is it possible to run pdfAsset three times? That should generate three absolutely independent documents with other styling, volumes, or templates.

masiorama commented 10 months ago

Yup, I skipped the pdfEntry with a dummy one, passed via custom prop all the needs, therefore create 3 different links. It works, even if I skypped entirely the catalogPdfType field.