johnfercher / maroto

A maroto way to create PDFs. Maroto is inspired in Bootstrap and uses gofpdf. Fast and simple.
https://maroto.io
MIT License
1.48k stars 172 forks source link

Multiline text with indentation #400

Closed Enkh99 closed 1 month ago

Enkh99 commented 3 months ago

Is your feature request related to a problem? Please describe. I need text-indentation in props.Text opts.

Describe alternatives you've considered It can be hacked if there is only 1 line text, but in my case there will be multi-line text like paragraph.

Additional context In textgrid/v2/main.go file, there is line which mentionedissue that im facing, but there is no example of it

m.AddRows(text.NewRow(10, "Multiline text with indentation"))
Fernando-hub527 commented 2 months ago

Hello! I'm trying to help solve the problem, but I don't know if I understood correctly. In the example in the photo, I adjusted the distance of the paragraph from the margin and made a small indentation in the first line of the paragraph. Do you need to do something like this or did I make a mistake?

Captura de tela de 2024-03-22 23-37-11

Enkh99 commented 2 months ago

Hello! Yes sir

Fernando-hub527 commented 2 months ago

Excellent ! To do it this way I used the alignment and margin properties of "props.Text" and to indent the first line I added a space at the beginning of the text. Do you think this is a good solution or is it better to do it another way?