PDF Asian character support - JasperReports - pdf

I am trying to provide Asian character support for PDF documents created using Jasper Reports.
I have tried configuring jasper to use Asian character encoding with the iText-Asian libraries to no avail. For all of the different charsets I used the Asian characters always appear blank.
Has anyone successfully configured jasper reports to displayed Asian characters in PDF documents? If so How?!!

Yes. Font Extensions are the answer to everything. Well, at least they are the answer to this.
I wrote an article about font extensions. It shows specifically the case of Asian characters not showing up in the generated PDF, which appears to be your main symptom. By doing that you're sure to use a good font. And once you're using an appropriate font, then all your reports should be fine.

Related

How to convert unusual unicode characters (UTF-8) to PDF?

I would like to convert a text file containing Unicode characters in UTF-8 to a PDF file. When I cat the file or look at it with vim, everything is great, but when I open the file with LibreOffice, the formatting is off. I have tried various fonts, none of which have worked. Is there a font file somewhere on my Ubuntu 16.04 system which is used for display in a terminal window? It seems that would be the font to tell LibreOffice to use.
I am not attached to LibreOffice. Any app that will convert the text file into a PDF file is fine. I have tried txt2pdf and pandoc without success.
This is what the file looks like
To be more specific about the problem, below is an example of what the above lines look like in LibreOffice using Liberation Mono font (no mono font does better):
I answered to you by mail, but here is the answer. You are using some very specific characters; the most difficult to find being in the Miscellaneous Symbols unicode block. For instance the SESQUIQUADRATE which sould is on your second line as ⚼.
A quick search lead me to the two following candidates (for monospace fonts):
Everson Mono
GNU Unifont
As you can see, the block is partially covered by PragmataPro which is a very good font; however, I tried with an old version and found all your own characters, but an issue occured because the Sun character (rendered as ☉) seems to be printed twice wider than the other characters, but my version of this font is rather old and perhaps buggy.
Once you have chosen the font suiting your needs, you may be able to render your documents as PDF with various tools. I made all my experiments with txt2pdf which I use daily for many documents.

How to export text document containing astral Unicode characters to PDF

I regularly create documents that need Unicode characters above U+FFFF. Unfortunately, OpenOffice and LibreOffice are both unable to correctly export these characters when creating a PDF. The actual data gets mangled by a completely asinine algorithm, while the display just consists of various overlapping question mark boxes.
This is not a font issue. I embed all used fonts in the PDF and all characters below U+FFFF work perfectly fine.
Until now I have been working around this issue by mapping the glyphs I need to a custom PUA font. This solves the display problems, but obviously makes the actual content of the text unsearchable and quite fragile. I haven’t been able to find any settings that might affect the handling of Unicode characters in PDF.
Therefore I have three questions:
Is there a way to make OpenOffice/LibreOffice handle astral characters correctly on PDF export?
If not, is there an external tool that can convert .odt files to PDF while preserving astral characters?
If not, is there another good rich-text editor using a different file format that can deal with astral characters in PDFs?

wkhtmltopdf and chinese characters

Trying to generate a PDF with wkhtmltopdf but it gives me a lot of trouble displaying all the characters.
Some of characters work - e.g. when printing
"Invoice No (付款编号)" Chinese character no 1, 2 and 4 are correctly printed but character no 3 just displays an empty space in the PDF.
"Customer no (客户编号)" Chinese character no 1 and 4 are correctly displayed but character no 2 and 3 aren't displayed in the PDF.
"Total (总额)" none of the Chinese characters are displayed in the generated PDF.
I'm on a Ubuntu 14.04 desktop system with wkhtmltopdf version "wkhtmltopdf 0.12.1 (with patched qt)". I have installed the Chinese fonts and all the characters are correctly displayed in both gedit and Firefox on my system, but wkhtmltopdf only displayes about 75% of them.
My HTML document is made in with UTF-8 character set and is correctly displayed in Firefox and gedit. I have also tried to embed the font-face directly in the style section of the header using the src: url(data:font/ttf;base64,AAEA....) tag and wkhtmltopdf changes the font face as expected but the missing characters are still missing.
Any help is really really appreciated as I'm getting out of ideas.
Did you install the Chinese, Japanese, and Korean Fonts that are mentioned in the Ubuntu Community Help Wiki?
Looking at the PDF generated on another System in detail, you can find out which font is used by wkhtmltopdf on that system and then locate the proper substitute.
Dalibror Nasevic did the work for a large subset of asian fonts and described what he had to install on a CentOS (RedHat) based system:
Figuring out missing fonts for wkHTMLtoPDF
On a headless Debian-stretch-based system, according to Dalibror Nasevic I had to add
fonts-droid-fallback,
fonts-wqy-microhei and fonts-wqy-zenhei
In addition, following the recommendations from the Ubuntu Community Help Wiki, fonts-dejima-mincho, fonts-nanum-coding, fonts-takao, fonts-takao-gothic, fonts-takao-mincho might be worth giving a try.

Japanese, Russian or English characters in dynamic Text Field for PDF

Perhaps someone could help me : I've got a problem with my project. I've got a dynamic pdf report, generated by Jasper, which contains dynamic TextField in Japanese, Russian or English text, and could be in Bold, Itallic or Normal Font. This report is generated in a multi- language application, but I've no way to know in which language the input text has been originally written.
I try to use the font delivered by Microsoft ARIAUNI.TTF, but the problem is that this font doesn't work with bold or italic Japanese characters.
I've got some solutions (like remove all bold or italic TextField in my jrxml file), but I don't find it an ideal solution.
Has anyone had ever such a problem ? Does someone have a good solution for it?
Thanks in advance,
Matthieu Blanchard
We use the "Arial MS" font for Japanese characters specifically. Works nice for us.

Why are asian unicode characters not appearing on PDF using FPDF in PHP?

I am using FPDF to create a PDF and tFPDF to allow for unicode characters, such as Chinese, Japanese, or Korean.
I am using the ex.php that was in the tFPDF example files.
I added some Japanese and Chinese Characters to the Hello World.txt file, but those characters are not showing up, even in the default DejaVu font that was included.
What do I need to do to make other characters like Japanese, Chinese, Korean show up?
The API that you're using needs to provide specific support for encoding the unicode characters that you're trying to add to the document. This is done by way of a codepage / charset for those characters. There are a number of different charsets available for Japanese, Chinese and Korean characters such as Hangeul, GB2312, Chinese Big 5, Shift JIS, etc.
The API that you're using needs to support the charset that matches the text which you're trying to add.
It looks like FPDF supports some Chinese codepages since there's some info on their forum about adding text using GB2312 and Chinese Big 5, but as they don't appear to mention unicode on their main pages, my guess is that they don't provide extensive support for it.
There is a multi byte version of fpdf called mbfpdf (freely available I suppose). With that and the PGOTHIC font, it is possible to display Asian characters. I have used this class (mbfpdf) to create a few pdf files myself and it worked well.