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

Print page and save to PDF #49

Closed
marios88 opened this issue Nov 13, 2018 · 6 comments
Closed

Print page and save to PDF #49

marios88 opened this issue Nov 13, 2018 · 6 comments

Comments

@marios88
Copy link
Contributor

I read you have the issue in your TODO list

I am currently using the command line of chrome to generate PDFs but its very lacking in options compared to the puppeteer version. Since i dont have nodejs in my current env, i am stuck with it :(

My use case is, that i generate the HTML and feed it to chrome and grab the resulting file

Since this library supports sending direct commands to chrome,
has anyone successfully generated and saved PDFs?

Thank you for your time

@gsouf
Copy link
Member

gsouf commented Nov 13, 2018

Hi @marios88

That's not implemented yet. Might be done quickly though

@marios88
Copy link
Contributor Author

Thanks for the quick reply @gsouf

Looking forward to it!

@tanasecosminromeo
Copy link
Contributor

@marios88 @gsouf Happy to make a PR, currently you can only do basic print as pdf settings (default, set orientation and paper size) but we could only improve later I think

@tanasecosminromeo
Copy link
Contributor

@gsouf Please check #50

@marios88
Copy link
Contributor Author

@tanasecosminromeo
Indeed it seems easy to implement the rest of the options. i will test it within the week and report back

@gsouf
Copy link
Member

gsouf commented Nov 14, 2018

@marios88 that's available in version 0.6.0:

$page->pdf([
    'landscape' => true,   // default false
    'printBackground' => true   // default false
])->saveToFile('/tmp/file.pdf');

@gsouf gsouf closed this as completed Nov 14, 2018
@marios88 marios88 mentioned this issue Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants