HTML to PDF / DOCX / RTF Java converter library Forums PD4ML Forums Technical questions / Troubleshooting Generated pdf does not have the entire HTML stream-pd4ml-4.0.17

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #38376

    Hi,
    Greetings. Hope you are well! I am trying to generated a pdf from a html stream recently we upgraded the platform to latest version and with that pd4ml has been upgraded to 4.0.17. There is no entire html content in the generated pdf and the pdf formatting also does not look good, can you please have a look at the java code and the attached html stream to see if something is changed in v4.0.17?

    Java Code:
    /* Implementing using the PD4ML API per Pega Support Documents
    https://community.pega.com/support/support-articles/not-able-set-margin-pdf-document
    */
    String PD4ML_DOCUMENT_VIEW_MODE =”pd4ml.document.view.mode”;
    org.zefer.pd4ml.PD4ML pd4ml = new org.zefer.pd4ml.PD4ML();
    com.pd4ml.PD4ML pd4mlNew = new com.pd4ml.PD4ML();

    java.awt.Insets margins = new java.awt.Insets(30,25,30,25); // Add letter border (top, left, bottom, right)
    pd4ml.setPageInsetsMM(margins);

    pd4ml.setPageSize(org.zefer.pd4ml.PD4Constants.A4);
    pd4ml.protectPhysicalUnitDimensions();
    pd4ml.interpolateImages(true);

    java.util.Map m = new java.util.HashMap();
    m.put(org.zefer.pd4ml.PD4Constants.PD4ML_ABSOLUTE_ADDRESS_SPACE, “document”);
    //pd4ml.setDynamicParams(m);
    pd4ml.pd4mlNew.setParam(PD4ML_DOCUMENT_VIEW_MODE,”TwoPageRight”);

    java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();

    org.zefer.pd4ml.PD4PageMark footer = new org.zefer.pd4ml.PD4PageMark();
    footer.setPageNumberTemplate(“$[page] of $[total]”);
    footer.setPageNumberAlignment(org.zefer.pd4ml.PD4PageMark.RIGHT_ALIGN);
    footer.setColor(new java.awt.Color(0x303030));
    footer.setInitialPageNumber(1);
    footer.setPagesToSkip(0);
    footer.setFontSize(11);
    footer.setAreaHeight(20);
    footer.setFont(new java.awt.Font(“Times-Roman”,0,11));
    pd4ml.setPageFooter(footer);

    pd4ml.render(new java.io.StringReader(HTMLStream), baos);

    baos.close();

    return baos.toByteArray();

    Regards,
    Bharat

    Attachments:
    You must be logged in to view attached files.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.