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)
org.zefer.pd4ml.PD4PageMark footer = new org.zefer.pd4ml.PD4PageMark();
As a test: can you try using the OOTB HTMLTOPDF activity - to convert an HTML file that contains the same image ?
I *believe* that using HTMLTOPDF (or even the lower-level Engine API "PDFUtils pdfUtil=tools.getPDFUtils();") performs the additional task of fetching the static content (including images) from the PRPC store to present to the PD4ML library.
If you use the PD4ML library (again, this is my belief) - this step will not happen and the library will not be able to find the images.
With regard to the image being downloaded with the wrong file extension : you probably need to get the BYTES of the converted PDF and provide this to the 'sendFile' engine API to correct this (which will allow you specify a filename).
What version of PRPC are you using ? Does the HTMLTOPDF activity not provide you with the parameters you need for the borders etc ? (if not; you wish to log a Enhancement Item ("Feedback Item") to see whether this parameters can be included a future version of PRPC : this will not help you in the short-term of course).
Since this enhancement needs vetting by the Pega Product Management Team, it is best to push this request through your Account Executive. Product Requests are for issues with the product and it is not a medium to influence the Product Management Team. Your Account Executive might be able to get the timelines for you!
To find out your Pega Account Executive, you could check with the Support Contact inside your organization or call up the Pega Support numbers listed here: Support Contact Information