pdfviewhelpers icon indicating copy to clipboard operation
pdfviewhelpers copied to clipboard

Possibility to import multiple pages as template

Open grempa opened this issue 4 years ago • 2 comments

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.

grempa avatar Nov 08 '19 10:11 grempa

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 avatar Nov 08 '19 12:11 maechler

@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.

maechler avatar Dec 18 '23 15:12 maechler