bithost-gmbh / pdfviewhelpers

TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.
GNU General Public License v3.0
44 stars 20 forks source link

Possibility to import multiple pages as template #139

Open grempa opened 4 years ago

grempa commented 4 years ago

I miss one big feature.

Add possibility to import whole sourceFile and not just a single page. Maybe something like: <pdf:page importPage="all" ...>...</pdf:page>

This would become really useful, as i want to have a base pdf which is then added some pages to.

maechler commented 4 years ago

This is currently not possible, but a workaround could be to use a for loop like this:

<f:for each="{0:1, 1:2, 2:3, 3:4}" as="pageNumber">
    <pdf:page importPage="{pageNumber}" ></pdf:page>
</f:for>

If we add such a feature, it would probably also be helpful to be able to provide more than one sourceFile. We could reuse the PageViewHelper or create a new one:

<pdf:importPages pages="all" sourceFile="path/to/file.pdf" />
<pdf:importPages pages="1" sourceFile="path/to/file.pdf" />
<pdf:importPages pages="1,2,4" sourceFile="path/to/file.pdf" />
<pdf:importPages pages="2-3" sourceFile="path/to/file.pdf" />

We would probably also have to account for different page sizes in the source PDF.

maechler commented 10 months ago

@grempa There is now a ViewHelper to attach a complete PDF file:

<pdf:document>
    <pdf:attachPdf path="EXT:pdfviewhelpers/Resources/Public/Examples/ExtendExistingPDFs/pdf_template.pdf" />
</pdf:document>

I will change this to an improvement to maybe rework and extend the API of that ViewHelper.