pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manoranjan Gahana <manoranjan.gah...@splashbi.com>
Subject Hebrew Language supports for PDF box
Date Tue, 14 May 2019 08:31:21 GMT
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"


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:  manoranjan.gahana@eistech.com<mailto:carol.griffeth@eistech.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message