I'm trying to insert Arabic text into a pdf using pdfbox
File myFile = new File("src/arabic/arial.ttf");
PDFont font = PDType0Font.load(doc, myFile);
PDPageContentStream contentStream = new PDPageContentStream(doc, page,true,true);
contentStream.beginText();
contentStream.setFont(font, 12);
contentStream.newLineAtOffset(30, 40);
String arabicText = "عطي يونيكود رقما فريدا لكل حرف" ;
// System.setProperty("ste.encoding", "UTF-8");
contentStream.showText(arabicText);
contentStream.endText();
contentStream.close();
The Arabic text appears as disconnected text in the resultant pdf.