PD4ML v4 Forums PD4ML v3 Archived Forums (Read Only) Troubleshooting Encoding problem (pdf only)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27064

    Hello!

    We use 3.9.0 version now, but we want to update to 3.9.8f4 (Pro). But it is problem with text encoding.

    HTML code (minimize):
    <br /> <!DOCTYPE html><br /> <html xmlns="http://www.w3.org/1999/xhtml"><br /> <head><title>Header</title><br /> <meta content="text/html; charset=utf-8" http-equiv="content-type"/><br /> <style><br /> body {<br /> font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;<br /> }<br /> <br /> h4 {<br /> font-family: inherit;<br /> }<br /> </style><br /> </head><br /> <body><br /> <h4>Название по-русски</h4><br /> </body><br /> </html><br />

    My program:
    <br /> PD4ML pd4ml = new PD4ML();<br /> pd4ml.outputFormat(PD4Constants.PDF);<br /> pd4ml.useTTF("java:fonts", true);<br /> pd4ml.setDefaultTTFs("Times New Roman", "Arial", "Courier New");<br /> <br /> try (InputStream resourceAsStream = Pd4mlTest.class.getResourceAsStream("temp.html");<br /> InputStreamReader inputStreamReader = new InputStreamReader(resourceAsStream, "UTF-8");<br /> ByteArrayOutputStream os = new ByteArrayOutputStream()) {<br /> pd4ml.render(inputStreamReader, os);<br /> InputStream is = new ByteArrayInputStream(os.toByteArray());<br /> FileUtils.copyInputStreamToFile(is, new File("C:\1.pdf"));<br /> }<br />

    It is text ‘Еазван-ÑЀ¸ÑЃμÑ Ð•Ñ¿Ð•Ð¾ºÐ’ instead of ‘Название по-русски’ in result PDF.
    But it converts to RTF correct.

    Old version (3.9.0) also make correct conversion.

    #29861

    Try to use

    pd4ml.render(StringReader isr, OutputStream os, URL base, String encoding)

    and explicitly give “UTF-8” as encoding parameter.

    #29862

    …and make sure you use PD4ML Pro.

    PD4ML Std does not support national scripts.

    #29863

    @PD4ML wrote:

    …and make sure you use PD4ML Pro.
    PD4ML Std does not support national scripts.

    It is Pro version, because it render to RTF correct.
    The problem is only in PDF and only with h1-h6 tags and only with font-family: inherit;

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

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