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
docs(examples): render custom HTML to PDF #3376
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
|
CLAs look good, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on a scenario where this would be useful for someone?
add example to create an HTML page in memory, render it with puppeteer and save it as a pdf file.
If you have a server that renders HTML and you want to generate pdf from any page, you can use this code to do it instead of navigating to an internal page with I've tried with I thought it would be useful for somebody else. Thanks for reviewing it! |
@guumaster The "goto hack" is a consequence of #728; I'd rather have it fixed than spreading the hack further. #728 requires contributing upstream to Chromium and DevTools protocol; let me know if you want to give it a shot. |
Probably I can't contribute to #728 to Chromium. This example may not be too important. But is not such a hack either, it is something that you can normally do with a browser, and Thanks for your time anyway. PS: You think you can merge it if I get the example working with |
add example to create an HTML page in memory, render it with puppeteer and save it as a pdf file.