feat(client): implement printing pages as PDF#285
Merged
jonhoo merged 3 commits intojonhoo:mainfrom Mar 29, 2025
Merged
Conversation
jonhoo
requested changes
Feb 16, 2025
Owner
jonhoo
left a comment
There was a problem hiding this comment.
Really good PR, thank you! Some smaller notes. I also wonder how we could write a test for this?
51071e4 to
2c59560
Compare
Contributor
Author
I wrote unit tests to cover all the builder error variants and an integration test that checks the magic bytes of the PDF. |
c5be7c7 to
93f17bd
Compare
93f17bd to
6b070af
Compare
Owner
|
Ah, some of the CI is racy: fixed in #293. Btw, easier if you merge into this MR than force-push. It makes reviews much simpler on my end. I'll still squash before merging! |
Merged
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements print page to PDF through the WebDriver2 API, which can for example be used to generate PDF documents from HTML + CSS templates.
I found the
webdriverAPI really unforgiving, so I wrapped everything in constructors and tried to check as much as possible ahead of time.