Am 14.05.2019 um 10:31 schrieb Manoranjan Gahana:
Hi Team,


We have a requirement to generate report on hebrew language using pdfbox.

I have developed a sample program . I am using Lato-Regular font .


Below is the issue i am getting :


"No glyph for U+05D0 in font Lato-Regular"


Please check whether that font contains the hebrew glyphs that you are using.

(A nice tool for this is DTL OTMaster 3.7 light)

Tilman





public class PDFBoxTest {
public static void main(String[] args) throws IOException {
PDDocument document = new PDDocument();
document.save("E:/R&D/pdfbox/hebrew.pdf");
PDPage page = new PDPage();
                 document.addPage(page);
                 document.save("E:/R&D/pdfbox/hebrew.pdf");
PDPageContentStream contentStream = new PDPageContentStream(document, page);
contentStream.beginText();
File unicodeFileLocation = new File("E:/R&D/pdfbox/Lato-Regular.ttf");
PDFont unicodeFont = PDType0Font.load(document, unicodeFileLocation);
contentStream.setFont(unicodeFont, 12);
contentStream.newLineAtOffset(25, 500);
String text = "אח‬ט‬"; // Hebrew text
contentStream.showText(text);
contentStream.endText();
System.out.println("Content added");
contentStream.close();
document.save(new File("E:/R&D/pdfbox/hebrew.pdf"));
document.close();
System.out.println("completed..........");
}
}

Can you please help me on this ?

Thanks & Regards
Manoranjan Gahana
Mobile: +91 7207055389
Email:  [email protected]<mailto:[email protected]>



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to