How to (horizontally) align text of PDTextField in PDFBox?

后端 未结 1 1279
再見小時候
再見小時候 2020-12-21 13:26

I have a program that create TextFields inside a PDF-file so it can be used as a form. I would like to have the text I write in the TextFields I created to be centered thou

相关标签:
1条回答
  • 2020-12-21 14:03

    Use the Q flag:

    textBox.setQ(PDTextField.QUADDING_CENTERED);
    

    Other possible values are QUADDING_RIGHT and QUADDING_LEFT (which is the default).

    0 讨论(0)
提交回复
热议问题