HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › HTML/CSS rendering issues › Issue with TTF embedding.
- This topic has 2 replies, 2 voices, and was last updated Apr 24, 2014
10:50:20 byPD4ML.
-
AuthorPosts
-
April 21, 2014 at 05:13#26920
Hi,
I am using pd4ml 350 pro version, I am performing some trials to verify if pd4ml can embed a GDT font and display correct symbols inside pdf.
I followed steps mentioned in section “7.1 TTF embedding” to configure fonts directory.I am trying to convert following html to PDf with Ascii and Unicode character values for one of the GDT symbol,
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><table width=100% style="width:100%; border:1px solid black; text-align:center; font-family:Arial; font-size:10"><tr><td><font style="font-family:'GDTEX';">ASCII : é Unicode : é</font></td></tr></table></body></html>part of sample java code I wrote to test is as follows,
String strFilePath = "D:/tempGDt.pdf"; File output = new File(strFilePath); java.io.FileOutputStream fos = new java.io.FileOutputStream(output); StringBuffer sbTemp = new StringBuffer("<With above sample html>"); PD4ML html = new PD4ML(); html.enableDebugInfo(); html.setHtmlWidth( 870 ); html.setPageSize(PD4Constants.A4); html.setPageSize( new java.awt.Dimension(842, 595) ); html.setPageInsets( new java.awt.Insets(30, 30, 30, 30) ); html.enableImgSplit(true); html.interpolateImages(false); html.useAdobeFontMetrics(true); html.useTTF( "D:/fonts", true ); StringReader sr = new StringReader(sbTemp.toString()); html.render(sr, fos); fos.close();When above code is executed, a PDF file is generated with blank pages. Following is the debug log,
version: PD4ML 350 Pro not yet in cache: file:D:/fonts/pd4fonts.properties new parse attempt with: UTF8 not yet in cache: file:D:/fonts/arial.ttf read 'arial' from file:D:/fonts/arial.ttf not yet in cache: file:D:/fonts/gdtex.ttf read 'gdtex' from file:D:/fonts/gdtex.ttf done in 278ms.
Can anyone please answer whats going wrong, or if I am missing anything.
I have tried same stuff with latest released pro trial, it also outputs a blank pdf without any hint in debug log as whats going wrong.April 24, 2014 at 05:40#29528Can anyone please answer above query!!.
Also Is there any specific criteria for a TTF file to be compatible with PD4ML pro version. Is there a way to confirm that a TTF is compatible with PD4ML.April 24, 2014 at 10:50#29529Did you try the most recent (trial) version 390b2 of PD4ML Pro?
Hopefully the issue of v350, you faced with, has been already solved in recent releases.
-
AuthorPosts
The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.
