OpenPDF icon indicating copy to clipboard operation
OpenPDF copied to clipboard

RTL Issue with english and arabic content in single PDF

Open knshalini opened this issue 2 years ago • 1 comments

Issue: I use both arabic and english in my pdf. I need arabic content to be in RTL (right to left) and english to be in LTR (Left to right) and I tried to achieve RTL by enabling layoutprocessor. However both English and arabic are displayed in RTL direction.

To Reproduce: import com.lowagie.text.pdf.LayoutProcessor; LayoutProcessor.enable(java.awt.Font.LAYOUT_RIGHT_TO_LEFT);

Used the above mentioned code to enable RTL. Reference Document: https://github.com/LibrePDF/OpenPDF/wiki/Accents,-DIN-91379,-non-Latin-scripts

Expected behavior Need English to be in LTR and arabic contents to be in RTL.

Please check and assist on how to resolve on this.

knshalini avatar Jul 05 '22 12:07 knshalini

Use LayoutProcessor.enable(); for automatic selection of direction for each chunk of text. Not a bug, description is clarified.

vk-github18 avatar Jul 16 '22 09:07 vk-github18