Classification SAFRAN IDENTITY AND SECURITY :INDUSTRY CONFIDENTIAL
Hello,
I'm using pdfbox version 2.0.6 on Linux 7.
My Java program reads a pdf template file and fill some areas (image and text)
to produce a new pdf document .
There is English text written LeftToRight and Arabic text to be written
RightToLeft.
Here is an extract of template document loading and configuration :
{code}
....
fontStream = classLoader.getResourceAsStream("arialbd.ttf");
logger.debug("Loading PDF template file ");
doc = PDDocument.load(pdfTemplateStream);
logger.debug("Loading font file into the document");
PDFont font = PDType0Font.load(doc, fontStream);
// Will edit the page 0
PDPage page = doc.getPage(0);
doc.setDocumentInformation(docInfo);
PDPageContentStream content = new PDPageContentStream(doc, page,
PDPageContentStream.AppendMode.APPEND, false, true);
content.setFont(font, fontSize); ...
{code}
Here is an extract of adding text :
{code}
content.beginText();
content.showText(text);
content.endText();
{code}
My problem is that the Arabic text is not printed correctly into the pdf
document, I do not know Arab language so it is hard to see what is wrong but my
feeling is that the text is written in a wrong order...
For example the following text composed of 'Single' + a slash + the Arab
translation of the word 'Single' : Single / زيارة واحدة Is printed like this :
Single / ةرايز ةدحاو
Any Idea what I should do to fix this ?
Thank you.
This message has been marked as INDUSTRY CONFIDENTIAL by MELIQUE Denis (MORPHO)
on 06/13/2017 15:22:02.
- - - - -
Ce message a été classifié INDUSTRY CONFIDENTIAL par MELIQUE Denis (MORPHO) le
13/06/2017 15:22:02.
#
" This e-mail and any attached documents may contain confidential or
proprietary information. If you are not the intended recipient, you are
notified that any dissemination, copying of this e-mail and any attachments
thereto or use of their contents by any means whatsoever is strictly
prohibited. If you have received this e-mail in error, please advise the sender
immediately and delete this e-mail and all attached documents from your
computer system."
#