} ?>
Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Interesting change in File handling between Java 6 and Java 7

31 sec read

One of the things we do in our PDF library is to scan the Font directories (ie C:/win and /Library/fonts) for any TrueType or OpenType fonts to use in our PDF viewer. On the Mac, this contains some ‘interesting’ files.

When we switched over to Java 7, they started to show this error in our code….

java.io.FileNotFoundException: /Library/Fonts/������������������������ ProN W4.otf (No such file or directory)

at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:97)

We can easily trap this by checking the file exists first with

new File(fontPath + currentFont).exists()

but it is a definite change in the way the File function works. Have you found any similar ‘changes’?

This post is part of our “Fonts Articles Index” in these articles we explore Fonts.



Do you need to solve any of these problems in Java?

Convert PDF to HTML5
Convert PDF to HTML5
Convert PDF to SVG
Convert PDF to SVG
View Forms in the browser
View Forms in the browser
Java PDF Reader and Viewer
View PDF Documents
Convert PDF to image
Convert PDF to image
Extract Text from PDF
Extract Text from PDF
Read/Write images in Java
Read/Write images
Replace ImageIO
Replace ImageIO
Convert Image to PDF
Convert Image to PDF
Mark Stephens Mark has been working with Java and PDF since 1999 and is a big NetBeans fan. He enjoys speaking at conferences. He has an MA in Medieval History and a passion for reading.

Leave a Reply

Your email address will not be published. Required fields are marked *

IDRsolutions Ltd 2020. All rights reserved.