Forum Replies Created

Viewing 15 posts - 826 through 840 (of 1,410 total)
  • Author
    Posts
  • in reply to: problem with background-color and font face
    #28654

    We planned to release it this week. Probably it will take a couple days more.

    Regarding the remaining issues:

    1. The background style will work if you change <font> to . We’ll try to make it working for <font> too.

    2. In order to output texts with Impact font face, you need to utilize TTF embedding feature of PD4ML Pro:
    pd4ml-html-css-pdf-tips-tricks-f7/ttf-embedding-t42.html

    in reply to: JSP to PDF Performance
    #28663

    1. PD4ML JSP taglib is a lightweight wrapper for PD4ML API – from resource consumption perspective it makes almost no difference which approach is in use. However we recommend to use the taglib where possible, as it implicitly solves some HTTP-specific issues you may face using “naked” PD4ML API in webapp scenarios (it sets correct cache control HTTP headers to avoid failures of particular combinations of MS IE+Acroread etc)

    2. PD4ML is thread safe (the shared internal resources are protected from race conditions and dead locks), but its methods are not re-enterant: you should not call render() methods of a single PD4ML instance from multiple threads simultaneously. The best practice would be to create a new PD4ML instance for each conversion request. Multiple PD4ML instances may work safe in parallel, but you should take into account – HTML rendering is a resource consuming task. Too many processes may take too many system resources.

    Here is some useful info about:
    https://pd4ml.com/performance.htm

    in reply to: problem with background-color and font face
    #28652

    The problem with combined underline and line-through CSS styles (or corresponding HTML tags) has just been fixed in the development build. Now it also supports overline text decoration. To be available with the forthcoming beta release.

    We’ll address the rest of the issues tomorrow.

    in reply to: Encoding problem (æøå)
    #28660

    > And what is the java.net.URL base for?

    base is for relative path calculations. InputStreamReader or StringReader simply provide no info to resolve relative paths.

    Well, in your sample code it is not quite clear where connection variable comes from. If your source document can be addressed by URL, it is good idea to use one of render(URL) methods. In the case html.overrideDocumentEncoding(“iso-8859-1”) should work for you as expected.

    in reply to: Encoding problem (æøå)
    #28658

    new parse attempt with: UTF8
    is caused by an encounter with <meta> encoding directive.

    In your code overrideDocumentEncoding() takes no effect, as if works only for render(URL) methods.

    /**
    * sets default encoding for URL-addressed HTML documents
    * @param encoding name
    * @since v3.7.1
    */
    public void overrideDocumentEncoding( String encoding ) {

    As long as you pass the HTML source as an InputStreamReader, it uses a charset of the reader. You may try to use InputStreamReader constructor with Carset parameter. But a better approach would be to call
    render(StringReader isr, OutputStream os, URL base, String encoding)

    > But the characters like æøå is supported by ISO-8859-1.
    Obviously the problem is caused by an attempt to interpret ISO-8859-1 document as UTF-8. First we need to make sure it is parsed as ISO-8859-1. Please try the above suggestions.

    in reply to: Encoding problem (æøå)
    #28656

    PD4ML supports by default ISO-8859-1 charset only. In order to output international characters you need to utilize TTF embedding feature of PD4ML Pro.

    pd4ml-html-css-pdf-tips-tricks-f7/ttf-embedding-t42.html

    in reply to: Generate PDF from XSLT file
    #28649

    In the case first you need to use Xalan or other XSLT transformer to produce HTML from the source XML/XSL.

    You may find some useful hints in the sources of Dxl2Pdf, which converts DXL to HTML. https://pd4ml.com/command-line-dxl-to-pdf-converter.htm

    in reply to: CSS Style width/heigth not working for checkbox
    #28648

    We’ve just added a possibility to scale checkbox and radio elements.
    The feature will be available with the forthcoming release.

    in reply to: How to find out if a page break has occurred
    #28546

    PD4ML can repeat a table header after a page break (pd4ml.enableSmartTableBreaks(true)). But it does not allow to add, for example, “(continued)” to the original header. So probably the trick with table headers will work for you.

    PD4ML Pro allows you to define page-specific headers in a case you use <pd4ml:page.header> tag.

    1. The tag supports scope attribute. For example: scope=”1″ defines header for the first page only; meaning of scope=”2+”, scope=”4-5″ is hopefully obvious. On the top of HTML page you may define multiple <pd4ml:page.header> tags with different scope attribute values.

    2. Also <pd4ml:page.header> without scope attribute may appear somewhere in the document body. In the case it impacts all subsequent pages (until it is overridden by another <pd4ml:page.header> tag)

    For your sample in theory it should be like that:

    Italy.
    <hr>
    <pd4ml:page.header>
    Italy (continued)
    <hr>
    </pd4ml:page.header>
    item<br>
    item<br>
    item<br>
    item<br>
    item<br>
    item<br>
    item<br>
    item<br>
    <pd4ml:page.header></pd4ml:page.header>
     

    However I tested the code and it does not work as desired. In a case of multiple header definitions/redefinitions on a single page only the last header definition takes effect. We’ll check if it possible to improve the algorithms to support the above idea.

    in reply to: A definition of custom resource loaders
    #27263

    Is CustomFileResourceProvider.class in the classpath?

    If so, try to enable debug (pd4ml.enableDebugInfo()) and inspect server’s log.

    in reply to: improper rendering of css
    #28646

    Please attach the source HTML and CSS

    in reply to: A definition of custom resource loaders
    #27261

    > Is there a way I can pass the InputStream of the image as an arguement to the ResourceProvider.

    You need to reference somehow the image in the database from an HTML source. It is up to you: you may even implement a repository of InputStreams (which would be a quite strange architectural decision) and refer to them by a unique input stream ID:

    Image from the forum topic: A definition of custom resource loaders

    In the resource loader you’ll receive “file:inputstream#4711” image URI to be parsed, to select the corresponding input stream and to read the referred image.

    But of course a better approach is to specify in the image URI some unique key, sufficient to lookup and to read database image with your custom resource loader.

    in reply to: css style control of checkbox will lose after convert to pdf
    #28642

    I converted the HTML snippet and the result looks ok. See attached.

    Probably in your case there are some extra styles, that reduce the font size. I cannot tell exactly as I seen neither entire HTML document, not its PDF output.

    in reply to: css style control of checkbox will lose after convert to pdf
    #28640

    It would be nice to take a look to the resulting PDF. Could you please attach it (with its source HTML) or send to support pd4ml com

    > checkbox displays much larger than in html
    What does “larger” mean? Is it comparing to other objects or texts of the document, or does it appear bigger in Acroread comparing to the web browser view?

    in reply to: NullPointerException in render
    #28645

    Obviously the issue is PD4ML-version-dependent. I tried to convert the HTML you sent with the actual version of PD4ML and did not reproduce the exception.

    On the other hand the resulting PDF layout did not match the layout as it appears in the popular web browsers. Please note: despite the product name “HTML-to-PDF converter”, PD4ML is not intended for web sites capture. Our goal is on PDF side: it is to allow you to define PDF layouts of any level of complexity with a language everybody knows – HTML.

Viewing 15 posts - 826 through 840 (of 1,410 total)