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

Add image stamping for TextField elements #700

Merged
merged 2 commits into from
Dec 20, 2020
Merged

Add image stamping for TextField elements #700

merged 2 commits into from
Dec 20, 2020

Conversation

btecu
Copy link
Contributor

@btecu btecu commented Dec 11, 2020

Allows stamping an image on a TextField element in addition to Button elements.
Additionally, it now handles alignment, defaulting to Center for Button and using TextAlignment for TextField.

Copy link
Owner

@Hopding Hopding left a comment

Choose a reason for hiding this comment

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

@btecu Good idea! A couple things before merging:

  • Would you please update one of the existing integration tests with form field to exercise this new method on TextField?
  • Can you create a new enum called ImageAlignment rather than using the TextAlignment enum? Their values happen to be the same right now, but I'd prefer to keep them separated.

- Add test for image stamping for TextField elements
@btecu
Copy link
Contributor Author

btecu commented Dec 14, 2020

@Hopding feedback addressed!
I've modified one of the test PDFs and replaced one of the buttons used for image stamping with a text field.

@Hopding Hopding changed the base branch from master to TextFieldSetImage December 20, 2020 22:27
Copy link
Owner

@Hopding Hopding left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks again @btecu. I'll tweak a few things and then this feature will go out in the next release of pdf-lib.

@Hopding Hopding merged commit 7dc89cb into Hopding:TextFieldSetImage Dec 20, 2020
Hopding added a commit that referenced this pull request Dec 20, 2020
* Add image stamping for TextField elements (#700)

* Add image stamping for TextField elements

* - Add `ImageAlignment`
- Add test for image stamping for TextField elements

* Cleanup

Co-authored-by: Bj Tecu <btecu@users.noreply.github.com>
@btecu btecu deleted the image branch December 23, 2020 15:37
Hopding added a commit that referenced this pull request Aug 30, 2021
* Add image stamping for TextField elements (#700)

* Add image stamping for TextField elements

* - Add `ImageAlignment`
- Add test for image stamping for TextField elements

* Cleanup

Co-authored-by: Bj Tecu <btecu@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants