The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

amit.marwadi (2) [Avatar] Offline
#1
Hi,

I am trying to create PDF which will have table format and text in Japanese and many other languages.

My code is like -

*****************************************************************************
PrintWriter out = new PrintWriter(new BufferedWriter(
new OutputStreamWriter(new FileOutputStream (saveFile))));
BufferedReader lineReader = new BufferedReader(
new StringReader(simpleHtmlText));
String line;
while ((line = lineReader.readLine()) != null)
out.println (line);
lineReader.close();
out.flush();
out.close();

Document document = new Document(PageSize.A3, 0, 0, 90, 110);
PdfWriter.getInstance(document, new FileOutputStream(path+".pdf"));
document.open();
HTMLWorker worker = new HTMLWorker(document);
FileReader reader = new FileReader(path+".html");
worker.parse(reader);
reader.close();
*****************************************************************************

Here I am writing HTML file and then parsing that file to PDF, but i am getting questions marks for Japanease character.

Please guide me. how i need to code?

Thanks.
blowagie (284) [Avatar] Offline
#2
Re: Creating PDF with Japanese character
amit.marwadi (2) [Avatar] Offline
#3
Re: Creating PDF with Japanese character
I am sorry.