Some small Summary of itext PDF export and the generation of Chinese PDF in ireport

Source: Internet
Author: User

Like me, you may be worried about generating Chinese characters when generating PDF files. Maybe you and I are the same. You can see that someone else provides a bunch of jar files and cannot find the download location, I also searched for the last base camp for a long time. It was close-up to help you and me ;)

Give yourself a witness for over an hour .-_#

You just need to go

Http://prdownloads.sourceforge.net/itext/

You can find all the things you want, including the latest itext version and the itext Asian Language Pack.

======================================

Http://itext.sourceforge.net/downloads/itextasian.jaron the official website. The following address can be used.
Http://prdownloads.sourceforge.net/itext/iTextAsian.jar do not believe? If you have a try, remember the first one!

====================
In Java, ireport is a good report design tool for visual operations, but there are also Chinese problems. Typically, after itext is added, Chinese characters are garbled and exported to PDF files are garbled. The solution is as follows after exploration:
1 InIreportUnder the lib directory, add the itext Asian Language Pack (http://itext.sourceforge.net/downloads/iTextAsian.jar.), itext-1.01.jar;

2. In the itext text attribute box, set the font attribute:

  • Font Name: sansserif

  • PDF Font Name: stsong-light;

  • Select the PDF embedeed encoding check box.
  • Pdfencoding: UniGB-UCS2-V (Chinese Simplified)

This solves the problem of PDF in ireport ;)

================
Simply put

Select the font according to this rule.
Chinese Simplified
Stsong-light with the encodings UniGB-UCS2-H and UniGB-UCS2-V
Chinese Traditional
Mhei-medium and msung-light with the encodings UniCNS-UCS2-H and UniCNS-UCS2-V
Japan
HeiseiKakuGo-W5 and HeiseiMin-W3 with the encodings UniJIS-UCS2-H, UniJIS-UCS2-V, UniJIS-UCS2-HW-H and UniJIS-UCS2-HW-V
Korean
Hygothic-medium and hysmyeongjo-medium with the encodings UniKS-UCS2-H and UniKS-UCS2-V

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.