Forum Replies Created

Viewing 15 posts - 2,656 through 2,670 (of 4,333 total)
  • Author
    Posts
  • in reply to: Troubleshooting
    #26934

    I am using .tiff images for my PDF and they are not appearing when the letter is being generated.

    There are no errors in the logs. When I use .png images, they work.

    Any comments would be helpful.

    in reply to: Javascript is not getting executed with PD4ML
    #29546

    PD4ML does not support Javascript and we have no plans to support it. The topic with a tricky workaround is discussed by the link:
    html-css-to-pdf-rendering-issues-f3/is-javascript-supported-t216.html

    Alternatively you may give a try to PD4ML Web wrapper to a PhantomJS HTML->PDF converter module. https://pd4ml.com/pd4ml_web.htm Its functionality is planned to be included to PD4ML v4 as an option.

    in reply to: General questions / FAQ
    #26935

    Hello Sir,

    I my html , I am creating bubble symbols using bellow style.

    .bubble-1 {min-width:18px; border-radius:100%;} for <i> tag

    But in pdf ‘border-radius:100%‘ is not applicable and <i> tag is also not there in PD4ML styles

    Can you help me how to apply bubble(round symbols in pdf).

    Thanks,
    Sathish.H

    in reply to: need servlet code for converting html string to pdf
    #29038

    Hi,

    I have been using the below sample code in my application. I have been using the demo jar.

    PD4ML html = new PD4ML();
    html.setPageSize(new java.awt.Dimension(450, 450));
    html.setPageInsets(new java.awt.Insets(20, 50, 10, 10));
    html.setHtmlWidth(750);
    html.enableImgSplit(false);
    response.setHeader("Content-Disposition", "attachment; filename=test.pdf");
    
    URL base = new URL("file:D:/home.jsp");
    html.render(url, baos);

    Is this feature available in PD4ML library or in PD4Ml library PRO? I have to give this info to my procurement team.

    in reply to: General questions / FAQ
    #26936

    Hi,

    I have been using the below sample code in my application. I have been using the demo jar.

    PD4ML html = new PD4ML();
    html.setPageSize(new java.awt.Dimension(450, 450));
    html.setPageInsets(new java.awt.Insets(20, 50, 10, 10));
    html.setHtmlWidth(750);
    html.enableImgSplit(false);
    response.setHeader("Content-Disposition", "attachment; filename=test.pdf");
    
    URL base = new URL("file:D:/home.jsp");
    html.render(url, baos);

    Is this feature available in PD4ML library or in PD4Ml library PRO? I have to give this info to my procurement team.

    in reply to: need servlet code for converting html string to pdf
    #29039

    The code works with both Std and Pro versions.

    The Pro version would also allow you to embed TTF fonts and to display with them non-Latin and special characters.

    in reply to: Is demo jar PD4ML library or in PD4Ml library PRO?
    #29548

    The code works with both Std and Pro versions.

    The Pro version would also allow you to embed TTF fonts and to display with them non-Latin and special characters.

    in reply to: TTF embedding
    #27317

    By default PD4ML converts to PDF characters, belong to Latin-1 charset only using built-in Adobe fonts (Helvetica, Times New Roman and Courier New). In order to output national or special characters you would need to configure and utilize TTF embedding feature. See:

    https://pd4ml.com/reference.htm#7.1
    pd4ml-html-css-pdf-tips-tricks-f7/ttf-embedding-t42.html
    https://pd4ml.com/cookbook/pd4ml_pdf_true_type_fonts.htm

    in reply to: Is <em> tag supported?
    #29424

    tag is supported – it is just a synonym to in a PDF conversion context.

    in reply to: General questions / FAQ
    #26937

    Hi, I am pd4ml rookie here. So, please forgive me if I am asking a primeval question.
    I am trying to integrate pd4ml with phantomjs to generate a pdf from html that contains javascript. So far, I was unable to generate for a simple html using the web module. I searched for examples but could not find anything to my satisfaction. I am posting my actual code here.
    This is my java code(taken from the toc example provided in the downloads). The only change I made(as mentioned in https://pd4ml.com/pd4ml_web.htm) was to use the web.pd4ml package. I am using the same sample.html file that comes with the example.

    package main;
    
    import java.awt.Dimension;
    import java.awt.Insets;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    
    import org.zefer.pd4ml.PD4Constants;
    import org.zefer.pd4ml.PD4PageMark;
    import org.zefer.pd4ml.web.PD4ML;
    
    public class WebPageConverterWithPhantomJS {
    
    public static void main(String[] args) throws Exception {
    WebPageConverterWithPhantomJS converter = new WebPageConverterWithPhantomJS();
    String htmlFileName = "C:\DEV\workspace\PD4MLExample\examples\toc\sample.html";
    File pdfFile = new File("C:\DEV\workspace\PD4MLExample\examples\toc\sampleUsingPhantomJS.pdf");
    converter.generatePDF(htmlFileName, pdfFile, PD4Constants.A4,
    args.length > 2 ? args[2] : null, args.length > 3 ? args[3] : null );
    System.out.println("done.");
    }
    
    private void generatePDF(String inputHTMLFileName, File outputPDFFile, Dimension format, String fontsDir, String headerBody)
    throws Exception {
    
    java.io.FileOutputStream fos = new java.io.FileOutputStream(outputPDFFile);
    PD4ML pd4ml = new PD4ML("C:\DEV\workspace\PD4MLExample\public\tools\phantomjs.exe");
    pd4ml.setPageInsets(new Insets(20, 10, 10, 10));
    pd4ml.setHtmlWidth(950);
    pd4ml.setPageSize(pd4ml.changePageOrientation(format)); // landscape page orientation
    if ( fontsDir != null && fontsDir.length() > 0 ) {
    pd4ml.useTTF( fontsDir, true );
    }
    if ( headerBody != null && headerBody.length() > 0 ) {
    PD4PageMark header = new PD4PageMark();
    header.setAreaHeight( -1 ); // autocompute
    header.setHtmlTemplate( headerBody ); // autocompute
    pd4ml.setPageHeader( header );
    }
    pd4ml.enableDebugInfo();
    
    InputStream is = new FileInputStream(inputHTMLFileName);
    InputStreamReader isr = new InputStreamReader(is, "UTF-8");
    
    pd4ml.render(isr, fos);
    //pd4ml.render("file:" + inputHTMLFileName, fos);
    }
    }

    This is the change I made in the html . Included bootstrap css, font-awesome css, jquery and bootstrap js files.

    <META http-equiv=Content-Type content="text/html; charset=UTF-8">
    ..
    <LINK href="i/W3C-REC.css" type=text/css rel=stylesheet>
    <LINK href="i/default.css" type=text/css rel=STYLESHEET>
    <link rel="stylesheet" type="text/css" href="public/stylesheets/bootstrap-2.3.css"/>
    <link rel="stylesheet" type="text/css" href="public/stylesheets/font-awesome.css" />
    .
    .
    <script type="text/javascript" src="public/javascripts/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="public/javascripts/bootstrap-2.1.min.js"></script>
    .
    .
    </HEAD>
    <BODY>
    
    <script type="text/javascript">
    $(document).ready(function(){
    $(".thisred").addClass("red"); //testing only.
    });
    </script>
    
    ...
    </BODY>

    When I execute this code, it throws the error

    090b2 Pro (eval)
    ReferenceError: Can't find variable: $
    
    c:%5CUsers%5CUKALIVI%5CAppData%5CLocal%5CTemp%5Cpd4ml1002373815533658363.htm:29
    Exception in thread "main" java.lang.NoSuchMethodError: org.zefer.pd4ml.pdf.parser.h.o00000(Ljava/io/InputStream;)[B
    at org.zefer.pd4ml.web.PD4ML.Ò00000(Unknown Source)
    at org.zefer.pd4ml.web.PD4ML.render(Unknown Source)
    at main.WebPageConverterWithPhantomJS.generatePDF(WebPageConverterWithPhantomJS.java:50)
    at main.WebPageConverterWithPhantomJS.main(WebPageConverterWithPhantomJS.java:23)

    If I change the instantiation of pd4ml to :

    PD4ML pd4ml = new PD4ML("C:\DEV\workspace\PD4MLExample\public\tools\phantomjs.exe");

    I don’t get the error and the console shows done. But the pdf generated is not useful, the pd4ml tags were not recognized I think.

    090b2 Pro (eval)
    ReferenceError: Can't find variable: $
    
    c:%5CUsers%5CUKALIVI%5CAppData%5CLocal%5CTemp%5Cpd4ml2710392443226086703.htm:29
    done.

    Could you please let me know what I am missing here. Also, could you please provide some examples for integration with phantomjs.

    in reply to: .TIFF images not appearing in PDF
    #29547

    By default PD4ML supports only Fax-specific TIFF image sub-formats. Obviously in your case the TIFF format is not among the supported.

    A workaround would be to define a so-called custom resource loader and let it re-format a TIFFs to anything compatible.

    See:
    https://pd4ml.com/cookbook/custom_rc_loaders.htm
    and an attachment.

    in reply to: "Print Ready" PDFs?
    #29544

    Right now there is no way to generate PDFs with CMYK colorspace.

    You could request the feature implementation on an (affordable) paid basis.

    #29504

    Just released v390 addresses the issue. Do not forget to copy an updated ss_css2.jar from the distribution package to your application resources.

    in reply to: css @media parsing
    #28345

    Just-released v390 addresses the issue.

    Please give it a try.

    in reply to: Custom Fonts
    #27412

    on Win8.1 in cmd:

    I:xampphtdocspd4mlprobe>java -Xmx512m  -Djava.awt.headless=true -cp I:xampphtdocspd4mlpd4ml_demo.jar  Pd4Cmd "file:123.html" -ttf I:xampphtdocspd4mlfonts  800 A4  -debug -out pd4ml.pdf
    version: PD4ML 385fx6 Pro (eval)
    not yet in cache: file:I:xampphtdocspd4mlfonts/pd4fonts.properties
    'times' is not in pd4fonts.properties file
    reject TTF lookup for: 'times'
    not yet in cache: file:I:xampphtdocspd4mlfonts/times.ttf
    read 'times new roman' from file:I:xampphtdocspd4mlfonts/times.ttf
    'times bold' is not in pd4fonts.properties file
    reject TTF lookup for: 'times bold'
    not yet in cache: file:I:xampphtdocspd4mlfonts/timesbd.ttf
    read 'times new roman bold' from file:I:xampphtdocspd4mlfonts/timesbd.ttf
    ...

    I:xampphtdocspd4mlfonts/pd4fonts.properties
    or
    I:xampphtdocspd4mlfonts/times.ttf
    is the right path in windows system?

Viewing 15 posts - 2,656 through 2,670 (of 4,333 total)