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

feat(page): add omitBackground option for page.pdf method #6981

Merged
merged 3 commits into from Mar 18, 2021

Conversation

d-rowe
Copy link
Contributor

@d-rowe d-rowe commented Mar 13, 2021

Adds omitBackground option for Page.pdf to allow for transparent backgrounds. This option is available in the screenshot api, this change unifies this for both .screenshot and .pdf.

Related issues: #6906 #2545

@google-cla
Copy link

google-cla bot commented Mar 13, 2021

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 with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla google-cla bot added the cla: no label Mar 13, 2021
@d-rowe
Copy link
Contributor Author

d-rowe commented Mar 13, 2021

@googlebot I signed it!

Copy link
Contributor

@jschfflr jschfflr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi d-rowe, thanks for your contribution!
Your changes look good to me but it would be great if you could add a test for them.
I'm not sure how stable the pdf output is so maybe you can try testing it with golden snapshots (take a look at the screenshot tests to see how) and if that doesn't work we can find another way to at least have basic test coverage.
Thanks!

@d-rowe
Copy link
Contributor Author

d-rowe commented Mar 16, 2021

Thanks. Looks like the tests are only setup to compare pngs. Any suggestions for alternative ways to get some basic test coverage?

@jschfflr
Copy link
Contributor

Well if that's not currently set up to handle PDFs, I think we can skip it for now.
But maybe you can create a tracking bug for this on this repository so that we can take a look at it in the future.
Please also link to this pull request from that new issue. Thanks!

@jschfflr jschfflr enabled auto-merge (squash) March 17, 2021 14:32
@jschfflr jschfflr merged commit dc8ab6d into puppeteer:main Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants