-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
PageNumber support margin top/left #502
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: zirain <[email protected]>
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.
Hello, I noticed that there are just a few changes left to finalize the PR, and I believe they won't be very complex:
Currently, when the pageNumber is added to the PDF using the provider.AddText method, the method ensures that the text position does not exceed the cell limits (page dimensions minus margins). While this behavior is necessary in many situations, it prevents the pageNumber from being freely positioned.
To address this, I suggest creating a new AddPageNumber method in the provider, similar to AddText. However, this method should specifically limit the text position by the page dimensions instead of cell boundaries.
If you need any help implementing this suggestion, I'm happy to assist.
Signed-off-by: zirain <[email protected]>
Signed-off-by: zirain <[email protected]>
allow positioning text at any cell position when parameter is sent refector text object to use first letter of struct
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #502 +/- ##
==========================================
+ Coverage 87.94% 88.88% +0.94%
==========================================
Files 61 61
Lines 2330 2347 +17
==========================================
+ Hits 2049 2086 +37
+ Misses 246 215 -31
- Partials 35 46 +11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
The changes were almost correct, but for them to work, the addPageNumber method should bypass the validations made here. Instead of creating a new AddPageNumber method, I added a parameter to the addText method that allows you to define whether the text position should respect the page margins or not.
@Fernando-hub527 thanks for the help. |
@Fernando-hub527 can we merge this? |
Hi, the merge is done by @johnfercher , I believe he will soon be checking the pr  |
kindly ping @johnfercher |
Description
add a new filed
MarginTop
inPageNumber
which help on issues #495Related Issue
#495
Checklist
func (<first letter of struct> *struct) method() {}
name style.when,should
naming pattern.m := mocks.NewConstructor(t)
.m.EXPECT().MethodName()
method to mock methods.example_test.go
.make dod
with none issues pointed out bygolangci-lint