Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Incomplete
-
Affects Version/s: 6.1.2
-
Fix Version/s: None
-
Component/s: Font Engine
-
Labels:None
-
Environment:Windows7, java 1.7
-
ICEsoft Forum Reference:
Description
Code tried using Ice-pdf "Open Source" :
Approach:1 Packaging fonts using JAR
FontManager fontManager = FontManager.getInstance();
String jarFontPath = "d:/font-jar/icepdf-fonts.jar";
String jarFontPackage = "fonts";
// find the font names that are in the jar
List<String> fontNames = readJarFontNames(fontManager, jarFontPath);
fontManager.readFontPackage(jarFontPackage, fontNames);
Approach: 2 load font resources from a specific package
fontManager.readFontPackage("fonts", Arrays.asList(
new String[]{"Gopika.pfb",
"GopikaLightItalic.pfb",
"GopikaTwo.pfb",
"GopikaTwoBold.pfb","GopikaTwoBoldItalic.pfb","GopikaTwoItalic.pfb","TitleLightTwo.pfb","TitleLightTwoItalic.pfb","TitleTwo.pfb","TitleTwoItalic.pfb","gopb_.pfb","gopbi_.pfb","gopi_.pfb","gopl_.pfb"}));
Both the approaches not working to render fonts for particular pdf.
Code executes properly please find below mention logs.
n both case code is running properly and the received LOGS are:-
Jan 23, 2017 1:32:49 PM org.icepdf.core.pobjects.fonts.FontFactory <clinit>
FINE: NFont font library was not found on the class path
Jan 23, 2017 1:32:49 PM org.icepdf.core.pobjects.fonts.FontFactory createFontFile
FINE: Successfully loaded OFont: file:/C:/Users/MY_WorkSpacePath/Icepdf/bin/fonts/Gopika.pfb
Jan 23, 2017 1:32:49 PM org.icepdf.core.pobjects.fonts.FontManager readFontPackage
FINER: Adding system font: Gopika file:/C:/Users/MY_WorkSpacePath/Icepdf/bin/fonts/Gopika.pfb
.........same logs as above for other required fonts.......
At last....
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F1 - WinAnsiEncoding Times New Roman org.icepdf.core.pobjects.fonts.ofont.OFont@4c432981 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F2 - WinAnsiEncoding Gopika-Bold org.icepdf.core.pobjects.fonts.ofont.OFont@32fa5750 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F3 - WinAnsiEncoding TitleTwo org.icepdf.core.pobjects.fonts.ofont.OFont@2c83474 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F4 - WinAnsiEncoding Gopika org.icepdf.core.pobjects.fonts.ofont.OFont@36a5ffd3 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.util.content.OContentParser parse
FINER: End of Content Stream
Can it be a bug in Open source ?
Approach:1 Packaging fonts using JAR
FontManager fontManager = FontManager.getInstance();
String jarFontPath = "d:/font-jar/icepdf-fonts.jar";
String jarFontPackage = "fonts";
// find the font names that are in the jar
List<String> fontNames = readJarFontNames(fontManager, jarFontPath);
fontManager.readFontPackage(jarFontPackage, fontNames);
Approach: 2 load font resources from a specific package
fontManager.readFontPackage("fonts", Arrays.asList(
new String[]{"Gopika.pfb",
"GopikaLightItalic.pfb",
"GopikaTwo.pfb",
"GopikaTwoBold.pfb","GopikaTwoBoldItalic.pfb","GopikaTwoItalic.pfb","TitleLightTwo.pfb","TitleLightTwoItalic.pfb","TitleTwo.pfb","TitleTwoItalic.pfb","gopb_.pfb","gopbi_.pfb","gopi_.pfb","gopl_.pfb"}));
Both the approaches not working to render fonts for particular pdf.
Code executes properly please find below mention logs.
n both case code is running properly and the received LOGS are:-
Jan 23, 2017 1:32:49 PM org.icepdf.core.pobjects.fonts.FontFactory <clinit>
FINE: NFont font library was not found on the class path
Jan 23, 2017 1:32:49 PM org.icepdf.core.pobjects.fonts.FontFactory createFontFile
FINE: Successfully loaded OFont: file:/C:/Users/MY_WorkSpacePath/Icepdf/bin/fonts/Gopika.pfb
Jan 23, 2017 1:32:49 PM org.icepdf.core.pobjects.fonts.FontManager readFontPackage
FINER: Adding system font: Gopika file:/C:/Users/MY_WorkSpacePath/Icepdf/bin/fonts/Gopika.pfb
.........same logs as above for other required fonts.......
At last....
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F1 - WinAnsiEncoding Times New Roman org.icepdf.core.pobjects.fonts.ofont.OFont@4c432981 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F2 - WinAnsiEncoding Gopika-Bold org.icepdf.core.pobjects.fonts.ofont.OFont@32fa5750 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F3 - WinAnsiEncoding TitleTwo org.icepdf.core.pobjects.fonts.ofont.OFont@2c83474 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.pobjects.fonts.ofont.Font init
FINE: F4 - WinAnsiEncoding Gopika org.icepdf.core.pobjects.fonts.ofont.OFont@36a5ffd3 true
Jan 23, 2017 1:32:51 PM org.icepdf.core.util.content.OContentParser parse
FINER: End of Content Stream
Can it be a bug in Open source ?
The Open source variant doesn't use the FontManger the same way the PRO version does. The OS version can only read TrueType and some Type1 fonts via the AWT font class.
If you post a sample file we might be able to address the underlying rendering issue.