- This topic has 9 replies, 2 voices, and was last updated Mar 27, 2010
09:01:15 by PD4ML.
March 16, 2010 at 05:09#26342
The function call of “Pd4ml.render” take long for processing HTML with large PDF attachment.
Windows 2003 Standard Edition
Lotus Domino 7.03 FP1
PD4ML Java Library Pro
Our program is designed to generate PDF from Lotus Notes Email Document.
There are few steps to doing that:
1) Export a lotus Notes Document with attachment to DXL format file.
2) Use javax.xml.transform.Transformer class to convert DXL file to HTML file.
3) use pd4ml.render() function to convert HTML file to PDF.
Currently, we found that the time required to completed the function call “pd4ml.render” when the input HTML is transformed from Notes Document with a large size of PDF file attached. (e.g. 12MB PDF file need 11 minute to finish this function call).
Please kindly advise whether there is any method to speed up this case.
Part of the Code (full code of the agent is attached)
java.net.URL base = new java.net.URL(“http:/yahoo.com”);
java.io.StringReader isr = new java.io.StringReader(“file:” + readEncFile(inputHTMLFileName, “UTF8”));
pd4ml.render(isr, fos, base, “UTF8”); //The time between the printout of 17 and 18 shown up is about 11 min
System.out.println(“18”);March 16, 2010 at 10:47#27877
Please request the most recent XSL stylesheet and the reference agent code from support pd4ml.com by email.
I suspect the following: the default XSL stylesheet of the demo Notes database represents attachment files as
It takes a lot of time to parse such huge attribute value (if we are talking about tens of megabytes) and constantly reallocate string to store it.
The most recent XSL allows either to temporarily store the attachment to TMP directory and to refer to it from the attachment tag:
or to represent the attachment as tag body data:a-lot-of-base64-data. Both approaches are intended to solve the performance issue.March 17, 2010 at 10:42#27878
Firstly, thank for your prompt reply.
I have asked your company’s email support service to give me the new XSL. Your colleague, Igor had gave me the new XSL file. However, there some problem found.:
1) I found that new XSL file does not have the tag (
) which you mentioned in last reply.
2) The XSL file that your colleague, Igor sent to me that need me to try to un-remark the line No. 298 and 308 in order to use. I have tried to keep the remark and un-remark these 2 lines. But both does not improve my pd4ml.render() function. It still cause 10-11 minutes to complete. Also, it need me to increase Min heap size of domino to around 800MB in order to successfull run. My original setting of around 500MB Min heap size will cause the domino agent throw out of memory exception.
3) Then I try to change my agent to use the one that Igor send to me. However, I found that my current Jar library does not the API “generatePDFA”.
Please kindly advise what further step I can do in order to improve the speed.
Thank you very much!
Attached the XSL and agent code that Igor sent to me.March 18, 2010 at 09:46#27879
Please forward the questions again to Igor. Missing of generatePDFA() method, means you use old version of PD4ML (probably it is cached in the database).
It would also help if you uncomment DXL dump method in the agent code and send the output to us. It should help us to reproduce the issue and to provide you with a tuned XSL stylesheet.March 24, 2010 at 07:52#27881
We have tried to use the latest library “pd4ml.prof.360” and the latest XSL that your colleague, Igor send to me. We have tried both remark and un-remark the line No. 298 and 308 of the XSL. However, it still take about 10 min to generate a Notes Email with 10 MB attachment to the PDF using the new library, new XSL and my original coding. Please advise anyway that I can do speed up the PD4ML.render() function?
P.S. you can find our original agent code in the 1st thread of this Post.March 24, 2010 at 08:32#27880
In order to make sure you use not cached JAR version, please open the generated document in Acroread and go to File->Properties->Description->Producer. Is there really v360?March 25, 2010 at 04:41#27882
Just test after restart the Domino server and clicked “complile all” in Java Agent , still found that the PDF generated is in “PD4ML. HTML to PDF Converter for Java (324)”. Please kindly advise how can I clear the cache. Thanks.March 25, 2010 at 10:22#27883
Probably some steps are redundant, but try to
1. remove old JAR from agent resources using dominio designer
2. close and reopen the database again in domino designer
3. add the new JAR to the resources
4. close the database in domino designer and open in lotus notes.March 27, 2010 at 04:28#27884
We have changed our agent code using the latest jar (version 3.6) and XSL. Attached the PDFs generated using these new Jar. In the arcobat reader’s property, it shown that these PDF are generated by “PD4ML. HTML to PDF Converter for Java (360)”. So the problem of “cache” of old library is eliminated.
We have tried to generate PDF using the XSL with both line 298 to 308 remarked and un-remarked. However, it is found that it still need around 10 minute to generate a PDF of email with a 12MB attachment. Please kindly help to see whether this render() function can be speed up.March 27, 2010 at 09:01#27885
It is strange, both PDFs have no attachment.
Try also the following configuration switches:
– change private final static boolean dontPassAttachmentsToXalan = false; to true
– change String xml = dxl.exportDxl(tmp); to String xml = dxl.exportDxl(doc);
The forum ‘Troubleshooting’ is closed to new topics and replies.