pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Hebrew Language supports for PDF box
Date Tue, 14 May 2019 16:55:49 GMT
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:  manoranjan.gahana@eistech.com<mailto:carol.griffeth@eistech.com>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message