3
25
Fork
You've already forked fpdf
10

fpdf: fix autobreak when next page already exists #86

Open
mwoelk wants to merge 2 commits from mwoelk/main into main
pull from: mwoelk/main
merge into: go-pdf:main
go-pdf:main
mwoelk commented 2024年09月05日 16:21:18 +02:00 (Migrated from github.com)
Copy link

This PR fixes #85.

This is done by only creating a new page if we are currently on the last page.
Otherwise, we just advance the current page by one (use the already existing one) and update the y position to start at the top margin. Additionally we re-set the current font, color, and line styles similar to AddPageFormat

This PR fixes #85. This is done by only creating a new page if we are currently on the last page. Otherwise, we just advance the current page by one (use the already existing one) and update the y position to start at the top margin. Additionally we re-set the current font, color, and line styles similar to `AddPageFormat`
mwoelk commented 2024年09月05日 16:24:34 +02:00 (Migrated from github.com)
Copy link

@sbinet let me know if I should add any test or provide a reproduction repo.

@sbinet let me know if I should add any test or provide a reproduction repo.
sbinet (Migrated from github.com) reviewed 2024年09月11日 10:08:35 +02:00
sbinet (Migrated from github.com) left a comment
Copy link

apologies for the belated answer (coming back from a long vacation)

see my comment below.

apologies for the belated answer (coming back from a long vacation) see my comment below.
@ -2570,0 +2617,4 @@
}
f.color.text=tc
f.colorFlag=cf
}
sbinet (Migrated from github.com) commented 2024年09月11日 10:08:09 +02:00
Copy link

this seems to be a copy-paste of some of the content of AddPageFormat, w/o the "page open" prolog and some cleanup "postlog".

perhaps we could refactor AddPageFormat to use a non-exported method that does essentially what you copy-pasted here, and use that new non-exported method there ?

this seems to be a copy-paste of some of the content of `AddPageFormat`, w/o the "page open" prolog and some cleanup "postlog". perhaps we could refactor `AddPageFormat` to use a non-exported method that does essentially what you copy-pasted here, and use that new non-exported method there ?
mwoelk (Migrated from github.com) reviewed 2024年09月11日 11:00:04 +02:00
@ -2570,0 +2617,4 @@
}
f.color.text=tc
f.colorFlag=cf
}
mwoelk (Migrated from github.com) commented 2024年09月11日 11:00:03 +02:00
Copy link

Great idea! Wanted to keep the PR as short as possible but let's make it clean ;)

I'll be quite busy the next few days but I'll try to make the changes until end of week.

Great idea! Wanted to keep the PR as short as possible but let's make it clean ;) I'll be quite busy the next few days but I'll try to make the changes until end of week.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin mwoelk/main:mwoelk/main
git switch mwoelk/main

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff mwoelk/main
git switch mwoelk/main
git rebase main
git switch main
git merge --ff-only mwoelk/main
git switch mwoelk/main
git rebase main
git switch main
git merge --no-ff mwoelk/main
git switch main
git merge --squash mwoelk/main
git switch main
git merge --ff-only mwoelk/main
git switch main
git merge mwoelk/main
git push origin main
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
go-pdf/fpdf!86
Reference in a new issue
go-pdf/fpdf
No description provided.
Delete branch "mwoelk/main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?