Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1029

Use FileOutputStream to Create a UTF-8 PDF File

$
0
0

I am using JasperReports and DynamicReports with this piece of java code to create a report in pdf format which contains utf-8 characters, the problem is generated pdf file does not contain utf-8 characters at all, like if they have been replaced with "". is there any thing that i should be aware of when using OutputStream to create a utf-8 file?

    public void toPdf(String path){        OutputStream outHtml;        try {            outHtml = new FileOutputStream(path);            jasperBuilder.toPdf(outHtml);        } catch (Exception e1) {            logger.error("failed to create PDF", e1);        }}

this may be notable that creating XLS and HTML file faces no such problem.

note that there are lots of lines of code under jasperBuilder.toPdf(outHtml); that i have traced and no where in those lines my utf-8 characters are being eliminated. so i guess the devil is in outHtml = new FileOutputStream(path);


Viewing all articles
Browse latest Browse all 1029

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>