Question
PDF Generation from PD4ML
We are generating PDF documents from the correspondence templates, for generating it we are using PD4ML library instead of Pega OOTB HTMLtoPDF to achieve the customer requirements. Basically we are mentioning "10pt" as font size in the correspondence template but the generated PDF is showing as "11pt" or "10.5pt" font size.
PD4ML Code snapshot
try{
String sContent=sHtml;
org.zefer.pd4ml.PD4ML pd4ml = new org.zefer.pd4ml.PD4ML();
//pd4ml.resetAddedStyles();
pd4ml.setPageInsetsMM(new java.awt.Insets(10, 21, 0, 16));
pd4ml.enableImgSplit(false);
java.io.ByteArrayOutputStream os=new java.io.ByteArrayOutputStream();
java.io.InputStream is=new java.io.ByteArrayInputStream(sContent.getBytes());
java.io.InputStreamReader ris=new java.io.InputStreamReader(is);
pd4ml.setCookie("JSESSIONID",JSESSIONID);
pd4ml.setCookie("Pega-RULES",PEGARULES);
pd4ml.useTTF(FontsProp,false);
java.net.URL base=new java.net.URL(BASEURL);
pd4ml.enableDebugInfo() ;
pd4ml.render(ris,os,base);
byte[] byteArray=os.toByteArray();
// Action == Preview
if (Action.equalsIgnoreCase("Preview")){
String sPDF=Base64Util.encodeToString(byteArray);
ClipboardPage workpage = tools.findPage("pyWorkPage");
workpage.putString("PDFDocument",sPDF);
}
else {
tools.putParamValue("PDFDocument",byteArray);
}
}catch(Exception e){
throw new PRRuntimeException(e.toString());
}
***Moderator Edit: Vidyaranjan | Updated Categories, tagged SRExists***
Hello Mahesh,
This seems to be a known issue with PD4ML.
Check http://pd4ml.com/support/html-css-to-pdf-rendering-issues-f3/font-size-wierdness-t109.html
Best Regards,
Mounika