3
25
Fork
You've already forked fpdf
10

Text that goes over multiple lines in a cell, has an annoying line render under each line of the text. #52

Open
opened 2023年10月04日 01:10:23 +02:00 by ack3rs · 1 comment
ack3rs commented 2023年10月04日 01:10:23 +02:00 (Migrated from github.com)
Copy link

I have a cell (MultiCell) , which contains alot of text and it goes over multiple lines. Under each of the line, there is very small line, that is only visible when the background fill is not white. In the example the fill colour is #ed9063 and the offending line is #fd8928. Does anyone know how to get rid of it? is a bug or have I got some setting wrong?

I have pdf.SetLineWidth(0),

Screenshot 2023年10月04日 at 00 00 16

To duplicate, Just create a cell with a fill background to non-white and put text that wraps in it.

I have a cell (MultiCell) , which contains alot of text and it goes over multiple lines. Under each of the line, there is very small line, that is only visible when the background fill is not white. In the example the fill colour is #ed9063 and the offending line is #fd8928. Does anyone know how to get rid of it? is a bug or have I got some setting wrong? I have pdf.SetLineWidth(0), ![Screenshot 2023年10月04日 at 00 00 16](https://github.com/go-pdf/fpdf/assets/3899682/0d6e63ec-4ed2-4a1a-9d37-25a52aab499c) To duplicate, Just create a cell with a fill background to non-white and put text that wraps in it.
neox5 commented 2024年04月16日 14:04:42 +02:00 (Migrated from github.com)
Copy link

@ack3rs My idea would be to calculate the size of the text field and render a rect of that size behind the text. Therefore you have one continues area.

To get the text length and height you can use:

_, lineH := pdf.GetFontSize()
strW := pdf.GetStringWidth(str)
@ack3rs My idea would be to calculate the size of the text field and render a rect of that size behind the text. Therefore you have one continues area. To get the text length and height you can use: ``` _, lineH := pdf.GetFontSize() strW := pdf.GetStringWidth(str) ```
Sign in to join this conversation.
No Branch/Tag specified
main
v0.12.0
v0.11.1
v0.10.0
v0.11.0
v0.9.0
v0.8.0
v0.7.0
v0.6.0
v0.5.0
v1.4.3
v0.4.1
v0.4.0
v0.3.1
v0.3.0
v0.2.0
v0.1.0
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#52
Reference in a new issue
go-pdf/fpdf
No description provided.
Delete branch "%!s()"

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?