Discussion
CapGemini
IN
Last activity: 18 May 2022 11:48 EDT
images not displaying in PDF (generation using PD4ML)
I have a requirement to generate PDF with margins and attach to the case. Used correspondence rules to generates PDF. That correspondence rule having images which are located in"Webwb/". And also the images having visibility conditions (So, for this i created each JPG image as a separate correspondence rule and included those into the main correspondence rule with when rules).
To generate PDF with margins, I used customized PD4ML. When i go with below code, I am getting 2 issues.But, pdf is getting generated with specified margins. Please help me in getting out of this.
1. The images are not at all displaying in generated pdf.
2. The generated pdf is not having any file type (i.e pdf). When i try to view from case attachments the pdf is getting downloaded with no file type.
org.zefer.pd4ml.PD4ML PD4MLObject = new org.zefer.pd4ml.PD4ML();
//Set page size in points (8.5 x 11 inches)
//PD4MLObject.setPageSize( new java.awt.Dimension(595, 842) );
//Set margins in milimeters (top, left, bottom, right)
PD4MLObject.setPageInsets(new java.awt.Insets(25,25,25,25));
PD4MLObject.setHtmlWidth(710);
PD4MLObject.interpolateImages(true);
PD4MLObject.enableImgSplit(false);
org.zefer.pd4ml.PD4PageMark footer = new org.zefer.pd4ml.PD4PageMark();
String footertemplate = tools.getParamValue("pyPDFFooterHTMLTemplate");
footer.setHtmlTemplate(footertemplate);
footer.setAreaHeight(-1);
PD4MLObject.setPageFooter(footer);
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
PD4MLObject.render(new java.io.StringReader(HTMLStream), baos);
***Updated by moderator: Lochan to add Categories; add FDBK number***