Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to generate one pdf with multiple pages, each for one html output? #75

Closed
cve opened this issue Dec 11, 2014 · 7 comments
Closed

How to generate one pdf with multiple pages, each for one html output? #75

cve opened this issue Dec 11, 2014 · 7 comments

Comments

@cve
Copy link

cve commented Dec 11, 2014

Hi,

I want to generate 200 license agreements prepared to print in one pdf. Each page should have one twig rendered view. Is there a way to do that?

@arman-mukatov
Copy link

if I understand you correctly and all 200 license agreements you get in template(right away), after each cycle(license) you can is added as an bottom-padding of the div-container. In this way the following licenses agreements will be on a different page.

@waleedmazhar
Copy link

Put each page on a div as mentioned below.

{% for page in pages %}

Your Single page

{% endfor %}

.page {
page-break-after: always;
}

@CharlyPoppins
Copy link

Hi
so the solution is to have a view which render each views in a loop ?

or maybe there is a way Snappy can take a collection of rendered views as parameter ?

@markmbain
Copy link

@waleedmazhar thanks for the solution, works fine for me, with the loop in the template.

@akerouanton
Copy link
Contributor

snappy and wkhtmltopdf both support getting a bunch of input files/URLs (or input html for snappy) to generate a single pdf. I'll add a note about that in snappy documentation.

@gorvelyfab
Copy link

Thanks to @waleedmazhar
Your solution works fine again for me
your are my hero

@ahmetkursatesim
Copy link

I think you can create a main view by using partial views and take advantage of this by calling partial views in the main view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants