pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Query|PDFBox|Boxable|underline text
Date Tue, 20 Nov 2018 07:52:19 GMT
Am 20.11.2018 um 08:26 schrieb Sriprakash Singh:
> Hi,
> My name is Sriprakash Singh, Currently I am using library PDFBox/Boxable to create a
PDF.
> But I am clueless how to underline a text, As a workaround, I underlined the text using
table cell bottom border styling.Can you please give me better and proper way to underline
a text only not whole table cell as it creates width issue?

This mailing list is only for PDFBox. To underline text, you need to 
paint a line from start to end coordinates. This is done with 
PDPageContentStream.moveTo() and lineTo().

To get the width of your text, use PDFont.getStringWidth(), see javadoc 
(must multiply with 1000).

Tilman




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message