Generating PDF Reports in Chinese-Japanese-Korean

The original PDF specification was designed to create documents with 8 bit characters. Since the Chinese-Japanese-Korean (CJK) characters are 16 bits, they did not fit well in a PDF document. The PDF 1.3 specification (equivalent to Acrobat 4.0 and higher) added support for CID fonts. The CID fonts are designed specifically to handle fonts with a large character set and are capable of using 16-bit character encoding.

The PDF generation in Style Intelligence supports CID fonts with two new classes: PDF4Printer and PDF4Generator. They correspond to the PDF3Printer and PDF3Generator. Because these two classes generate PDF documents according to PDF 1.3 specification, the output can only be viewed using Acrobat 4.0 and higher.

Report Tool Demo Register

Font Installation and Text Insertion

To generate documents with CJK fonts, the Adobe Acrobat Asian Language Pack must be installed on the machine. You can choose to install one or all of the three languages supported by the pack: Chinese, Japanese and Korean. The language pack installs CID fonts for each of the selected languages.

CID fonts use the same format as TrueType fonts. However, the internal tables in the fonts are slightly different from regular TrueType fonts. Therefore, the CID fonts installed by the language pack cannot be used in Java (or OS) as regular fonts. In order to create a CJK document, a regular TrueType font also needs to be installed on the machine for the language. We will use Japanese as the example font in the following discussions. Chinese and Korean fonts are handled in the same way.

To create a document containing Japanese characters, first select the correct Japanese TrueType font (OS font) for the report element:

 // "MS Mincho" is a TrueType Japanese font
 report.setCurrentFont(new Font("MS Mincho", Font.PLAIN, 8)); 

Then we can insert the Japanese text into the report using the same StyleSheet API:

layout.addText("This is a Japanese character: \u1083"); 

If the report is created from a report template, the Japanese characters can be entered in the Designer and saved in the template file. The template file uses UTF8 encoding for text values and can handle all unicode characters correctly.

view demo icon
View a 2-minute demonstration of InetSoft's easy, agile, and robust BI software.
 

Create PDF4Printer or PDF4Generator

After the report is created, it can be viewed using the Previewer as usual. To generate the PDF document from the report, we first create a PDF4Printer (or PDF4Generator, which handles PDF bookmarks described earlier).

FileOutputStream output = new FileOutputStream("output.pdf");
ReportEnv.setProperty("font.truetype.path",
   "c:/winnt/fonts;d:/usr/acrobat4/resource/cidfont");
PDF4Printer pdf = new PDF4Printer(output);
pdf.putFontName("MS Mincho", "HeiseiMin-W3-Acro");

More Articles About Reporting

Garbage Collection Dashboards - Collection Efficiency Definition: Collection efficiency measures the ratio of garbage collected to the total amount of garbage that needs to be collected within a given timeframe. Significance: High collection efficiency indicates that the company is effectively managing its resources and adhering to scheduled pick-ups. It reduces the risk of missed collections, which can lead to environmental and public health issues. By tracking this KPI, companies can identify areas needing improvement, optimize routes, and ensure timely collections...

Insurance Coverage Dashboard Example - The Insurance Coverage Analysis Dashboard below is an example of InetSoft's interactive BI software. Targeted towards organizations of a many scopes, InetSoft's dashboard solution is ideal for users looking for simplicity, power, and performance. The chart below clearly demonstrates the simple nature of the dashboard. Still, there's a rich level of information and data that users can absorb from the available information chart by using the dragging sliders to filter information for effective and efficient analysis. By being able to narrow the results of different statistics, users can get a quicker and more accurate glance at the data being used. Effective business practices only enhance performance and InetSoft's feature-packed solution does just that for organizations...

Marcom Dashboards - Performance Tracking: Dashboards enable marcom professionals to track key performance indicators (KPIs) related to their marketing campaigns. These KPIs may include website traffic, conversion rates, email open rates, social media engagement, and more. By monitoring these metrics on a dashboard, marketers can assess the effectiveness of their marketing efforts and identify areas for improvement. Campaign Analysis: Dashboards help marcom professionals analyze the performance of specific marketing campaigns. They can track campaign metrics such as reach, impressions, clicks, conversions, and return on investment (ROI). By comparing data across different campaigns, marketers can identify successful strategies, pinpoint underperforming areas, and make data-driven adjustments to optimize future campaigns...

Pervasive BI Discussion - One great example an auto insurance company that we worked with. They were looking to improve customer service by streamlining certain functions. One improvement was the need to ensure accuracy in providing policy holder addresses to the independent agency partners so that correct public protection correction, or PPC codes, are assigned to their customers. Real-time access was critical for fast responses. They chose a service-oriented approach to help standardize their processes using WSDL and SOAP. They built such a data services framework to improve data accuracy that led to a reduction in underwriting risk. The team started by building two data services that were designed to be accessible by both agents and internal employees...

Sales Pipeline Metrics - Tracking the sales pipeline is one of the core elements of a dashboard for sales coverage analysis. This KPI offers a quick overview of the several phases a lead or prospect experiences prior to becoming a client. Among the metrics used in this category are: Conversion Rates: The proportion of leads that advance from one step of the sales funnel to the next is tracked by conversion rates. A well-optimized sales process is indicated by a better conversion rate...

Schedule Performance Index - SPI and CPI are essential KPIs for assessing the effectiveness of projects. Whereas the Schedule Performance Index gauges how quickly work is completed, the Cost Performance Index evaluates how cost-effectively completed work compares to the budgeted amount. Both KPIs are essential for assessing the health of a project and are often shown on dashboards to educate stakeholders...

Previous: PDF Report Generation