I have some utf-8 characters in jasperreports template. In iReport editor everything fine.
But after compiling the output PDf can not draw the valid unicode characters and draws ? instead.
How can I fix it?
Thank you
In order to enable unicode support in output PDF file you have to:
Add jasperreports-fonts-x.x.x.jar to project's classpath
In iReport select external font for textboxes and static text elements. Usually, it is DejaVu fonts
This is solution for latest versions of JasperReports (tested on 4.5.0)
if you have problems displaying UTF-8 characters in the pdf, no need to do anything! Just change the font of the cells in the table from sanserif to Dejavu sans. thats it.
Related
I got the following WARNING message:
No Unicode mapping for CID+2716 (2716) in font KMNIME+DFHei-Md-80-GB
Is tabula able to deal with font KMNIME+DFHei-Md-80-GB ??
Cheers
Yes, tabula definitely can work with Chinese characters, maybe it's because of your charset setting of your computer. Try adding -Dfile.encoding=utf-8 to your java command
Some files have non-standard mappings of Unicode code points to font glyphs. It is usually quite difficult to remap them.
Here's more information: Error when extracting text from pdf using pdfbox
I'm using Jasper Report and iReport 5.5.1. I created a grid using rectangles and inserted static text fields. My problem is that the PDF output created with Java is different from the iReport preview. Below you can see the three screenshots, first from the editor, the second is the preview and the third is the pdf output. We can see the overlap of the text and furthermore the bold title is not printed bold.
It looks like a font issue.
To achieve the common behavior across all the outputs, Open the Ireport designer and apply below properties:
Font Name = "Arial Unicode MS".
PDF font name = This property is deprecated, so leave it blank.
PDF Encoding = 'Identity-H (Unicode with horizontal writing)'.
Hope this help you.
Regards,
Srikanth Kattam
I have a database memo field stored as rich text format ( rtf). I can drop it in a report and set the format of the field as rtf within crystal reports version 11.5.10 and see the text without the rtf control characters. However, I want to construct a crystal reports formula/function to process the ascii text, so is there a way to programmatically within crystal report to strip the rtf control characters from the memo field so I can work with only the ascii characters ?
I could not find such a function within CR or mention of a solution to this problem by googling.
Cheers,
You could try looking at this.
http://tech.groups.yahoo.com/group/BillQuick/message/937?
I found it and used it to change/override RTF font settings to print large text for easier reading. It could probably be modified to strip to ASCII.
Cheers,
I have a html file with text encoded in a non-unicode font. I need to convert that file to unicode. I searched for a convertor. But, most of the convertors work for only a list of fonts, not for all fonts.
My font is very specific, text is in Devanagari script.
I have the file, I have the font, now, please suggest me a tool or technique. Thanks.
Unicode is not about fonts, it is about encoding. You need to find a converter that can convert your text to Unicode. What is the encoding of your text?
Apache Tika has the ability to pull text from PDF files via knowledge of font behavior. So if the file is in fact a PDF you have a chance. If you have a text file full of font indices in no particular encoding, you have a big programming job ahead of you.
i am using free pdf library libharu to generate PDF file,
but i have a encoding problem, i can not draw Thai lanugage text on PDF file,
all the text shows "???.."
Somebody know how to fix it?
Thanks
I have succeeded in rendering hieroglyphic texts (not Thai, but Chinese and Japanese) using libharu. First of all, I used Unicode mode, please refer to HPDF_UseUTFEncodings() function documentation.
For C language, here is a sequence of libharu API calls needed to overcome your trouble:
HPDF_UseUTFEncodings(docHandle);
HPDF_SetCurrentEncoder(docHandle, "UTF-8");
Here docHandle is a valid HPDF_Doc object.
Next part is proper work with UTF fonts:
const char * libFontName = HPDF_LoadTTFontFromFile(docHandle, fontFileName.c_str(), font_embed::EmbedFonts);
HPDF_Font font = HPDF_GetFont(docHandle, libFontName, "UTF-8");
After these calls you may render unicode texts containing Thai characters. Also note about embedding flag (3rd param of LoadTTFontFromFile) - your PDF file may be unreadable due to external font references. If you are not crazy with output PDF size, you may just embed fonts.
I've tested couple of Thai .ttf fonts found in Google and they were rendered OK. Also (it may be important, but I'm not sure) I'm using fork of libharu https://github.com/kdeforche/libharu which is now merged into master branch.
When you write text to the PDF, use the correct font and encoding. In the libharu documentation you have all the possibilities: https://github.com/libharu/libharu/wiki/Fonts
In your case, you must use the ISO8859-11 Thai, TIS 620-2569 character set
An example (in spanish):
HPDF_Font fontEn = HPDF_GetFont(pdf, "Helvetica-Bold", "ISO8859-2");
HPDF_Page_TextOut(page1, 50.00, 750.00, [#"Código para correcta codificación en libharu" cStringUsingEncoding:NSISOLatin1StringEncoding]);