You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by kevin <se...@126.com> on 2015/11/19 07:52:53 UTC

how to set the font with underline?

Hi,everyone!


I'm a newbee and want to use the pdfbox to create the pdf document.
I have read the guide and search some sample ,but  i can't find the way to set the character with underline?
Anyone give me a help,thanks in advance for you advice!




Re:Re: how to set the font with underline?

Posted by kevin <se...@126.com>.
Thanks! 

At 2015-11-19 15:23:20, "Tilman Hausherr" <TH...@t-online.de> wrote:
>Am 19.11.2015 um 08:18 schrieb kevin:
>> Hi,Tilman
>>
>>
>> Thank you very much,It seems draw a line at the position ,i will try it.
>> I suppose that if there is a underline method in the pdfbox like set the color method.
>> By the way ,the new question:
>> I can set the character to be Italic for the default font in pdfbox libary, but how can I set the font loading from external file to be Italic ?
>
>You just load a font that is already italic. In windows, open a command 
>line box and go to \windows\fonts and enter "DIR *I.TTF"
>
>Tilman
>
>>
>> Thanks very much,Again!
>>
>> At 2015-11-19 14:58:31, "Tilman Hausherr" <TH...@t-online.de> wrote:
>>> Hi,
>>>
>>> You simply draw a line at the position and length you want (moveTo,
>>> lineTo, stroke()). But you'll have to calculate / choose the position
>>> yourself. The length can be calculated with PDFont.getStringWidth(). The
>>> position is similar to the position of your text, although Y will be a
>>> bit lower.
>>>
>>> Tilman
>>>
>>> Am 19.11.2015 um 07:52 schrieb kevin:
>>>> Hi,everyone!
>>>>
>>>>
>>>> I'm a newbee and want to use the pdfbox to create the pdf document.
>>>> I have read the guide and search some sample ,but  i can't find the way to set the character with underline?
>>>> Anyone give me a help,thanks in advance for you advice!
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>For additional commands, e-mail: users-help@pdfbox.apache.org
>

Re: how to set the font with underline?

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 19.11.2015 um 08:18 schrieb kevin:
> Hi,Tilman
>
>
> Thank you very much,It seems draw a line at the position ,i will try it.
> I suppose that if there is a underline method in the pdfbox like set the color method.
> By the way ,the new question:
> I can set the character to be Italic for the default font in pdfbox libary, but how can I set the font loading from external file to be Italic ?

You just load a font that is already italic. In windows, open a command 
line box and go to \windows\fonts and enter "DIR *I.TTF"

Tilman

>
> Thanks very much,Again!
>
> At 2015-11-19 14:58:31, "Tilman Hausherr" <TH...@t-online.de> wrote:
>> Hi,
>>
>> You simply draw a line at the position and length you want (moveTo,
>> lineTo, stroke()). But you'll have to calculate / choose the position
>> yourself. The length can be calculated with PDFont.getStringWidth(). The
>> position is similar to the position of your text, although Y will be a
>> bit lower.
>>
>> Tilman
>>
>> Am 19.11.2015 um 07:52 schrieb kevin:
>>> Hi,everyone!
>>>
>>>
>>> I'm a newbee and want to use the pdfbox to create the pdf document.
>>> I have read the guide and search some sample ,but  i can't find the way to set the character with underline?
>>> Anyone give me a help,thanks in advance for you advice!
>>>
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>


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


Re:Re: how to set the font with underline?

Posted by kevin <se...@126.com>.
Hi,Tilman


Thank you very much,It seems draw a line at the position ,i will try it.
I suppose that if there is a underline method in the pdfbox like set the color method.
By the way ,the new question:
I can set the character to be Italic for the default font in pdfbox libary, but how can I set the font loading from external file to be Italic ?


Thanks very much,Again!

At 2015-11-19 14:58:31, "Tilman Hausherr" <TH...@t-online.de> wrote:
>Hi,
>
>You simply draw a line at the position and length you want (moveTo, 
>lineTo, stroke()). But you'll have to calculate / choose the position 
>yourself. The length can be calculated with PDFont.getStringWidth(). The 
>position is similar to the position of your text, although Y will be a 
>bit lower.
>
>Tilman
>
>Am 19.11.2015 um 07:52 schrieb kevin:
>> Hi,everyone!
>>
>>
>> I'm a newbee and want to use the pdfbox to create the pdf document.
>> I have read the guide and search some sample ,but  i can't find the way to set the character with underline?
>> Anyone give me a help,thanks in advance for you advice!
>>
>>
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>For additional commands, e-mail: users-help@pdfbox.apache.org
>

Re: how to set the font with underline?

Posted by Tilman Hausherr <TH...@t-online.de>.
Hi,

You simply draw a line at the position and length you want (moveTo, 
lineTo, stroke()). But you'll have to calculate / choose the position 
yourself. The length can be calculated with PDFont.getStringWidth(). The 
position is similar to the position of your text, although Y will be a 
bit lower.

Tilman

Am 19.11.2015 um 07:52 schrieb kevin:
> Hi,everyone!
>
>
> I'm a newbee and want to use the pdfbox to create the pdf document.
> I have read the guide and search some sample ,but  i can't find the way to set the character with underline?
> Anyone give me a help,thanks in advance for you advice!
>
>
>




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