PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: Trouble with server encoding (ISO-8859-15)
   PostPosted: 16 Nov 2011, 13:20 
Hi,
our server has ISO-8859-15 encoding (-Dfile.encoding=ISO-8859-15) but PD4ML only supports ISO-8859-1 so it is generating empty PDFs.

Is there any solution?

Thank you.

(P.D.: I'm the same person who posted this other topic and contacted with Igor Repinetski via e-mail some months ago. This time is not the same project/server.)


  Subject: Re: Trouble with server encoding (ISO-8859-15)
   PostPosted: 16 Nov 2011, 13:31 
The server log says:
new parse attempt with: ISO8859_1


  Subject: Re: Trouble with server encoding (ISO-8859-15)
   PostPosted: 16 Nov 2011, 14:53 
That is a clear sign, that the source HTML has a <meta> directive with ISO-8859-1. Try to change it to ISO-8859-15 and make sure you also utilize TTF embedding feature of PD4ML.

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


  Subject: Re: Trouble with server encoding (ISO-8859-15)
   PostPosted: 17 Nov 2011, 10:57 
I changed the page encoding and now it is not returning this line in log.

I tried specifying the encoding in the render method, but it doesn't work.

Code:
      StringReader input = new StringReader(content);

      HashMap map = new HashMap();
      map.put( "pd4ml.extra.resource.loaders", "package.CustomFileResourceProvider" );
      pd4ml.setDynamicParams(map);
      pd4ml.render(input,fos);


I removed all page content and only printing "HELLO" and then I tried printing the "content" value:
Code:
<?xml version="1.0" encoding="ISO-8859-15"?><html xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-15" />
   </head>
   <body>
                  HELLO
               
   </body>
</html>


I also tried by specifying TTF with these lines:
Code:
    pd4ml.useTTF( "java:fonts", true ); 
    pd4ml.setDefaultTTFs("Times New Roman", "Arial", "Courier New"); 


It continues returning an empty PDF as the one I attach.


Attachments:
File comment: Empty PDF I get.
failPDF.pdf [1.73 KiB]
Downloaded 83 times

[Reply]     [ 4 posts ] 

cron
Copyright ©2004-10 zefer|org. All rights reserved. Bookmark and Share