PDF Generating Tool Support Forum

HOME   Login   Register    Search




  Subject: can not change default encoding Cp1252 to UTF8 as specified
   PostPosted: 13 Jun 2011, 08:18 
Hi all,

When I call render() method I get the below error :

"can not change default encoding Cp1252 to UTF8 as specified in the source HTML: the given input stream reader does not support reset()".

Stacktrace :
version: PD4ML 361b2
java.io.IOException: can not change default encoding Cp1252 to UTF8 as specified in the source HTML: the given input stream reader does not support reset()
at org.zefer.html.doc.PD4MLHtmlParser.parse(Unknown Source)
at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source)
at org.zefer.pd4ml.PD4ML.super(Unknown Source)
at org.zefer.pd4ml.PD4ML.render(Unknown Source)

Can anyone help me out to resolve this issue?

- Thanks in advance.
MallikarjunBK


  Subject: Re: can not change default encoding Cp1252 to UTF8 as specified
   PostPosted: 14 Jun 2011, 15:11 
A good workaround would be to use render(URL,...) method instead of render(InputStream,...)

Another solution is to pre-read the source HTML into a byte array and to pass it to PD4ML.render() as a ByteArrayInputStream

Also you may run JVM with -file.encoding=UTF8 command-line parameter or to use a render() method, which accepts an encoding name as a parameter, but in the case your Java code is going to be dependent on the document content you are going to convert.



[Reply]     [ 2 posts ] 

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