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

Possible to remove margins only on cover page? #259

Closed
zakiaziz opened this issue Jul 27, 2017 · 9 comments
Closed

Possible to remove margins only on cover page? #259

zakiaziz opened this issue Jul 27, 2017 · 9 comments

Comments

@zakiaziz
Copy link

Hi, I'm making a call like this within laravel:

PDF::loadView('reports.body', ['data' => $data])
->setOrientation('landscape')
->setOption('cover', view('reports.cover', ['coverData' => $coverData]))
->setOption('header-html', view('reports.header', ['headerData' => $headerData]))
->setOption('footer-html', view('reports.footer', ['footerData' => $footerData]))
->setOption('margin-bottom', '0mm')
->setOption('margin-top', '0mm')
->setOption('margin-right', '0mm')
->setOption('margin-left', '0mm');

But the problem with that is it removes the header and footer in the body.

Is there an option to remove the margins only on the cover page?

@tushar32
Copy link

Same problem for me as well.Is this a bug in laravel snappy?

@zakiaziz
Copy link
Author

Probably not (though I'm not 100% sure). Laravel Snappy should be just a wrapper around this library.

@tushar32
Copy link

What is the solution then? I am thinking of using pdfmerger.

@tushar32
Copy link

How did you create Table of content using snappy?

@tushar32
Copy link

tushar32 commented Aug 14, 2017 via email

@zakiaziz
Copy link
Author

If the organizers are still present: I'm still looking for help on this issue

@akerouanton
Copy link
Contributor

@zakiaziz I'm afraid there's no solution for your problem: AFAIK margin applies on every pages of the document. As suggested by @tushar32, you can try to generate multiple PDFs and merge them together.

@tushar32
Copy link

In this case there is one more bug, if I merge two or more files together the table of content doesn't work.

@guicara
Copy link

guicara commented Jan 23, 2018

Hello,

Someone have created a PR request on the wkhtmltopdf repository for this feature.

Please see the ongoing issue: wkhtmltopdf/wkhtmltopdf#3635

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

4 participants