[ 
https://issues.apache.org/jira/browse/PDFBOX-4244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16510694#comment-16510694
 ] 

Jaroslav Mencl commented on PDFBOX-4244:
----------------------------------------

Hello, this is my piece of code:

 

java.io.File origFile = new java.io.File("c:\\temp\\emptypdf.pdf");
 PDDocument doc = PDDocument.load(origFile);
 PDPage page = doc.getPage(0);
 PDPageContentStream cs = new PDPageContentStream(doc, page, 
PDPageContentStream.AppendMode.APPEND, true, true);
 String winDir = System.getenv("WINDIR");
 String fontName = "EECode39N.ttf";
 org.apache.pdfbox.pdmodel.font.encoding.Encoding e = WinAnsiEncoding.INSTANCE;
 PDFont font = PDType0Font.load(doc, new File(winDir + "\\Fonts\\" + fontName));

 

Thank you for your help,

Jaroslav

> PDType0Font.load returns null
> -----------------------------
>
>                 Key: PDFBOX-4244
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4244
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.9
>         Environment: Windows 10, NetBeans 8.2
>            Reporter: Jaroslav Mencl
>            Priority: Major
>         Attachments: EECode39N.ttf
>
>
> Dear,
>  
> I need to put some barcode text into pdf using my jsp code. I use two fonts, 
> code39u.ttf and EECode39N.ttf (the behavior is the same with some system 
> fonts, whereas other work ok).
> PDType0Font.load function returns null, even if these fonts are correctly 
> installed and can be used elsewhere in my Windows OS. The load function does 
> not crash (that means the font file is found and ok).
> I used 2.0.8 version, but new 2.0.9 generates the error too.
>  
> Can you give me any help, please?
>  
> Jaroslav



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to