Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #26814

    Hi ,

    I am getting an out of memory erro while converting a dxl file to PDF File.
    Kindly help to resolve the issue.DXL file attached as txt file.

    Note:sometimes the DXL file converted to PDF but in the resulting PDF File I have the below text see the attachement.This is a multipart message in MIME format
    ContentElement(pd4content) [Dear Mr. Sharma and Mr. Singh,] {line-height=1.2000000476837158, white-space=pre, font-family=[Ljava.lang.String;@7f017f01, display=block, font-size=13}
    ContentElement(pd4content) [Thank you for your email below, this is great news! Please proceed to ] {line-height=scale (1.2000000476837158), white-space=pre, font-family=[Ljava.lang.String;@7f017f01, display=block, font-size=13}

    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R java.lang.OutOfMemoryError
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at java.util.ArrayList.newElementArray(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at java.util.ArrayList.growAtEnd(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at java.util.ArrayList.add(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.bb.super(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.bb.super(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.view.d.o00000(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.bb.super(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.view.d.o00000(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.bb.super(Unknown Source)
    [2/13/13 12:42:54:114 IST] 0000001b SystemErr R at org.zefer.html.doc.d.super(Unknown Source)

    #29211

    In most of the cases “This is a multipart message in MIME format” means the email message includes 2 content versions: HTML and text-only.

    I tested your DXL with PD4ML v381 – the build suppresses “This is a multipart message in MIME format”, however still outputs both content versions as PDF.

    OutOfMemory error usually can be handled with an overriding of Max Heap Size JVM parameter (i.e. -Xmx512m). But first I would recommend to give a try to PD4ML v381 – since v380fx5 you currently use – we addressed a number of DXL converting issues.

    #29212

    hi,

    I tried v381 pro but still out of memory error persist.I increased my JVM heap memory upto 1.5 GB after that i am not able to.Could you kindly let me know what is the max JVM heap memory to set to get rid off this type of out of memory error?

    Thanks

    #29213

    Could you please update on this issue.

    #29214

    Please update.

    #29215

    Please provide an update on this issue.

    #29216

    Please check if your Lotus agent (or standalone converter) calls extractAttachments( String dxl ) and after the call the attachment is replaced with something like that:
    file:/…/Temp/attachment13685.Undertaking.pdf

    #29217

    No there is nothing like that.

    #29218

    So it seems extractAttachments() method call takes no effect.

    Make sure the method code is in the most actual state (and invoked from your code):

    [language=java:1wluxbkf]public static final String extractAttachments( String body ) throws IOException {
    if (body != null) {
    int index01 = body.indexOf( “” );

    index02 = body.indexOf( ““, index01 + 1 );

    String fileName = “bin”;
    int name01 = body.lastIndexOf(“name='”, index02);
    if ( name01 > 0 ) {
    name01 += 6;
    int name02 = body.indexOf(''', name01);
    if ( name02 > 0 ) {
    fileName = body.substring(name01,name02);
    }
    }

    int endtag = body.indexOf( “>”, index01 + 1 );
    String fileContent = body.substring( endtag + 1, index02 );
    byte[] bytes = Base64.decode( fileContent );

    File file = File.createTempFile(“attachment”, “.” + fileName);
    FileOutputStream fos = new FileOutputStream(file);
    fos.write(bytes);

    String tmpFileName = file.toURI().toString();

    sb.append( tmpFileName );
    sb.append( “” );

    index02 += 11;
    index01 = body.indexOf( “

    #29219

    Hi ,

    I am not sure where you want me to add the above portion of the code.Looking at the code it seems to be like you are creating the file in temp folder and adding some temprefrence tag to the html body.But after adding if you could give the details of what we need to do this return value it would be very helpful.
    I also don’t want to store the file in temp loaction I just want to store the file in some file path other than temp folder.

    I will also give the code snippet of what I currenlty do to convert DXL to PDF and to extract attachements from the converted PDF File.

    I am using below method to conver the html to pdf.
    pd4ml.render(new StringReader(inputHTML), fos, new URL("file:."), "utf-8");
    The inputHTML for the above function is framed as below.The contents of the DXL file is XMl source and the Pd4ml.xsl as xsl soruce.The below function returns the html content needed to pass to the above render function.

    try {<br /> java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();<br /> <br /> javax.xml.transform.Source xmlSource = new javax.xml.transform.stream.StreamSource(new StringReader(xml));<br /> javax.xml.transform.Source xsltSource = new javax.xml.transform.stream.StreamSource(new StringReader(xsl));<br /> javax.xml.transform.Result result = new javax.xml.transform.stream.StreamResult(baos);<br /> <br /> javax.xml.transform.TransformerFactory transFact = javax.xml.transform.TransformerFactory.newInstance();<br /> <br /> javax.xml.transform.Transformer trans = transFact.newTransformer(xsltSource);<br /> <br /> trans.transform(xmlSource, result);<br /> <br /> return baos.toString("utf-8");<br /> }

    After the PDF file has been rendered I am extracting the attachement from that PDF file.

    Kindly let me know if I have to do in some alrternate way.

    #29220

    extractAttachments() is intended to extract base64-encoded bulky data chunks from DXL (and replace with a reference to a TMP file), before the DXL is passed to XSLT transformer – otherwise it causes XSLT transformer to consume a lot of memory and to lose performance.

    extractAttachments() deals with DXL not as with XML, but as with a long string. So it is sensitive to some XML formatting. The version I posted searches/replaces attachments more-less stable. You may use PdfAgent(R7).java or Dxl2Pdf.java extractAttachments() as a usage template (I thought your code is derived from one of the Java classes).

    PD4ML may deal equally with attachments originally embedded in DXL or with references to extracted attachments. With the references it is asa a rule more performant.

    #29221

    Where is these java files located (PdfAgent(R7).java or Dxl2Pdf.java) can you please provide the link?

    #29222

    Dxl2Pdf.java can be found in the package:
    http://pd4ml.com/dxl2pdf.2013.03.zip

    PdfAgentR7.java
    http://pd4ml.com/i/PdfAgentR7.java

Viewing 13 posts - 1 through 13 (of 13 total)

The forum ‘Troubleshooting’ is closed to new topics and replies.