0

We are using JasperReports to export pdf. It's working fine for

English :

Font -> Helvetica
Encoding -> CP1252

Japanese :

Font -> KozMinPro-Regular
Encoding -> UniJIS-UCS2-H

But not working for Korean Languages.

I set font and encoding in java as foillows:

   JRDesignReportFont font = new JRDesignReportFont();
   font.setPdfEncoding("KozMinPro-Regular");
   font.setPdfFontName("UniGB-UCS2-H");

I need the exact Font and Encoding Names.

Please give your suggestions.

  • 2
    Use font-extensions, find a ttf that renders Korean and then check this http://stackoverflow.com/questions/34041619/jasper-reports-pdf-doesnt-export-cyrillic-values/, http://stackoverflow.com/questions/33940126/how-can-i-display-%C2%A3%E2%84%A6%E2%82%AC%CE%B1%CF%80%E2%85%94-in-jasperserver-pdf-using-ireport and http://stackoverflow.com/questions/35127956/how-can-i-test-if-my-font-is-rendered-correctly-in-pdf – Petter Friberg Mar 28 '16 at 13:11

1 Answers1

0

"KozMinPro-Regular" is Japanese FontName and "UniGB-UCS2-H" is Chinese encoding.

For Korean language

font.setPdfFontName("HYSMyeongJo-Medium");
font.setPdfEncoding("UniKS-UCS2-H");
Yasuyuki Uno
  • 2,417
  • 3
  • 18
  • 22
  • Is there any restriction for using these font. When I tried I got some exception prints on my log. Caused by: net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font : pdfFontName : HYSMyeongJo-Medium pdfEncoding : UniKS-UCS2-H isPdfEmbedded : false| – Vijay Raja Mar 29 '16 at 21:12
  • @VijayRaja You need to add iTextAsian.jar to classpath. – Yasuyuki Uno Mar 30 '16 at 00:50
  • Thanks For the update. I checked the iTextAsian.jar and there is only Chinese and Japanese fonts properties file alone in jar. Hope need to include HYSMyeongJo-Medium.properties file and UniKS-UCS2-H.cmap – Vijay Raja Mar 30 '16 at 15:18
  • @VijayRaja hmm... It seems iTextAsian.jar includes Korean fonts and encodings... http://www.java2s.com/Code/Jar/i/Downloaditextasianjar.htm – Yasuyuki Uno Mar 31 '16 at 04:35
  • Uno, May be we are using old version of jar. Need to update to latest. – Vijay Raja Apr 04 '16 at 11:53