java itext create pdf with hebrew (rtl) and english

后端 未结 1 1823
误落风尘
误落风尘 2021-01-13 15:48

I want to create a pdf document containg english and hebrew together , I can see hebrew letters by using: BaseFont unicode = BaseFont.createFont(\"c:/windows/fonts/ari

相关标签:
1条回答
  • 2021-01-13 16:09

    You should be able to draw your text via an instance of ColumnText and get full BiDi support. You just need to setRunDirection to something other than PdfWriter.RUN_DIRECTION_DEFAULT.

    You might be able to get the same effect with ColumnText.showTextAligned() using the longer version with a non-default run direction:

    ColumnText.showTextAligned(contentByte, Element.ALIGN_LEFT, myParagraph, x, y, rotation,
      PdfWriter.RUN_DIRECTION_LTR, 0);
    

    This sets LTR as the default direction, and activates BIDI processing. Within a ColumnText, RUN_DIRECTION_DEFAULT is the same as RUN_DIRECTION_NO_BIDI.

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