phax / ph-pdf-layout

Java library for creating fluid page layouts with Apache PDFBox. Supporting multi-page tables, different page layouts etc.
Apache License 2.0
64 stars 11 forks source link

There is no vertical center style when I use Chinese font #20

Closed KenteJohn closed 3 years ago

KenteJohn commented 4 years ago

When I use Chinese font, there will be a default line break, one line displays two lines.

KenteJohn commented 4 years ago

And , there are also differents when I use regualr and bold fonts in Chinese.

phax commented 4 years ago

Can please paste a screenshot here of how it is and how you expected it to be? This library is "optimized" for left-to-right and top-to-bottom operations. hth

KenteJohn commented 4 years ago

ok, I will show you when I get home.

KenteJohn commented 4 years ago

By the way , I also have another question. When I have many PLTexts in a PLBox, these PLTexts will be huddled together, I dont want this. I want: if one PLText reach the line end, then next PLText will be skip to the next line.

phax commented 4 years ago

If you want each text to start with a new line, than I recommend you create a "table" like structure - e.g. with a PLVBox or even a PLTable.

KenteJohn commented 4 years ago

I am very busy these days. I am sorry to response to you so late. You will understand when you see the picture.

image

phax commented 4 years ago

Using setLineSpacing(0.5) helps to create a layout like this: grafik

KenteJohn commented 3 years ago

I have solved this problem. thanks.

phax commented 3 years ago

Super. How did you solve it?

KenteJohn commented 3 years ago

just setPaddingTop(-10)

KenteJohn commented 3 years ago

I have another question. How to add a hyperlink with your API, not PDFbox.

KenteJohn commented 3 years ago

There should be some methods in com.helger.pdflayout4.element.text.PLText to add a hyperlink.

phax commented 3 years ago

Yes, that is already requested in #13 - let me see what I can do