xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pascal Sancho <pascal.san...@takoma.fr>
Subject Re: AW: Zero width space is displayed as junk character [â€] in PDF
Date Mon, 09 Nov 2009 15:53:07 GMT
Hi,

I don't think that using ByteArray is a good pratice for XML stream, 
because you loose the codage information:
some characters may be encoded with 2 (or 3) bytes in utf-8, and after 
conversion into Bytes, you get 2 (or 3) bytes...
after that, coming back to String conversion, you get a 2 (or 3) chars 
length string, expalining what you get in your XML text file.

You should ensure that your XML streaming is not converted into Bytes at 
any time.

Pascal

sudhir543-dev@yahoo.com a écrit :
> Thanks you very much...
>
> Then why doesn't it work for me.. When I see document property in 
> Acrobat reader.. it shows me same fonts...
>  
>
> This is how I get bytes
>
>
>         ByteArrayOutputStream stream = new ByteArrayOutputStream();
>         StreamResult result = new StreamResult(stream);
>
>        Source xmlSource = new JDOMSource(document);
>        transformer.transform(xmlSource, result);
>
>         ByteArrayOutputStream out = new ByteArrayOutputStream();
>         Driver driver = new Driver(new InputSource(new 
> StringReader(stream.toString())), out);
>         driver.run();
>         return out.toByteArray();
>  
>
> *Thanks
> SN*


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message