PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) HTML/CSS rendering issues Mentioned Font size is not rendering in Generated PDF

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #26956

    We are mentioning the font size as 10pt in the HTML stream but generated PDF is getting rendered in 11pt
    code Snapshot:


    String sContent=sHtml;

    org.zefer.pd4ml.PD4ML pd4ml = new org.zefer.pd4ml.PD4ML();

    pd4ml.setPageInsetsMM(new java.awt.Insets(10, 21, 0, 16));
    //pd4ml.addStyle(“color:#8866ff; font-family:Times;”,true);
    java.io.ByteArrayOutputStream os=new java.io.ByteArrayOutputStream();
    java.io.InputStream is=new java.io.ByteArrayInputStream(sContent.getBytes());
    java.io.InputStreamReader ris=new java.io.InputStreamReader(is);
    //String sFontsProp=”/opt/jdk1.7.0_67/jre/lib/fonts/fonts.properties”;
    java.net.URL base=new java.net.URL(BASEURL);

    byte[] byteArray=os.toByteArray();

    // Action == Preview
    if (Action.equalsIgnoreCase(“Preview”)){
    String sPDF=Base64Util.encodeToString(byteArray);
    ClipboardPage workpage = tools.findPage(“pyWorkPage”);

    else {

    }catch(Exception e){

    throw new PRRuntimeException(e.toString());


    Initially PD4ML renders a document as for a screen representation (converted all physical units to screen pixels with 72dpi). After the layout is rendered it is stretched or shrank to match the target paper page width. See

    if you need to keep physical unit dimensions to exact on the paper, you either need to play with htmlWidth parameter or to trigger pd4ml.protectPhysicalUnitDimensions().

    (A drawback of the API call is a possible misbalance of resulting sizes of objects whose dimensions given in physical units and ones defined in screen pixels)

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

The forum ‘HTML/CSS rendering issues’ is closed to new topics and replies.