Gujarati fonts not displaying in PDF properly using itext 5.5.5 and xmlworker 5.5.5 - pdf

I am using arial .ttf file. I have tried different font file for gujarati such as lohit, padmaa, shruti but it not displaying properly. The characters are not getting substituted properly.
In PDF it displays as :
અરથ પરજ ડરમ વૈભવ સવગે
Originally it should display as:
અર્થ પ્રજા ડ્રમ વૈભવ સ્વર્ગે
I have tried using GlyphSubstitutionTableReader but its not working for me.
Please guide me. Thanks in advance.

iText 5 currently doesn't support any Brahmic scripts. The reason is that these require an implementation of a specific font table called GSUB, which simply isn't there yet. There is no way to get this to display correctly with iText 5.5.5, but anyone is welcome to try and implement it.

Related

p:dataexporter columns with images

I want to export a datatable (with p:graphicImages in columns) in PrimeFaces but even in the new version of PrimeFaces I can only see the alt: value of image in my PDF file. Can't I export graphicImage itself?
It's also asked in this link comment #3.
No you can't, not without extending the exporter
I can give you two ideas of how I got to put in a pdf images:
1. Use a printer (), then print it to pdf and you're done. You will have your table with the pretty images.
2. Generate the PDF using iText and you can personalize it as far as you want.

Incorrect Ruble-symbol on Invoice PDF prestashop 1.6 not showing properly

Using Prestashop 1.6 - and on the PDF's (Invoice & delivery) the Russian Ruble symbol won't render properly, converts to a "square". It is working without problem on all other areas of our site. Does anyone know how I can fix this? Thank you
It is linked to the font include in TCPDF, i think the font use for your iso code not include this symbole.
The font folder for TCPDF is :
https://github.com/PrestaShop/PrestaShop/tree/1.6.1.6/tools/tcpdf/fonts
How to found the font use by TCPDF?
https://github.com/PrestaShop/PrestaShop/blob/1.6.1.6/classes/pdf/PDFGenerator.php
In this file you can know what font use for your country iso code
The font use depend to country iso code, so for RU the font is freeserif.
So the font freeserif not include Rouble.
Solution?
Solution 1
The easy solution is to change in the https://github.com/PrestaShop/PrestaShop/blob/1.6.1.6/classes/pdf/PDFGenerator.php the font for your iso code by (dejavusans, cid0jp, ..) depending font in the folder tools/tcpdf/fonts.
Solution 2
The second solution, is to download TTF file who include the symbol(example you can search/download a font in http://www.dafont.com/) and generate a valid file with online converter
http://fonts.snm-portal.com/ (it is a first result for my search in google)
After you upload the file(s) generated in folder tools/tcpdf/fonts and edit the file PDFGenerator.php to point to your new font.

Docx4j DrawingML and VML (docx to PDF)

I am a bit new to Docx4j and "wordML".
I want to convert this docx to a pdf :
But my research showed me that drawingML and VML wasn't supported, at least yet.
like : http://www.docx4java.org/forums/pdf-output-f27/drawingml-vml-to-pdf-t949.html
Is it true ? Is there a way out of this problem with Docx4j or should I think of using another technology ?
Thanks in advance !
Generally speaking, docx4j’s PDF output is suitable for documents which contain paragraphs, tables and images. It can’t handle more exotic features, such as equations, SmartArt, or WordArt (DrawingML or VML).
source : http://www.docx4java.org/svn/docx4j/trunk/docx4j/docs/Docx4j_GettingStarted.pdf
I used the openoffice api : https://angelozerr.wordpress.com/2012/12/06/how-to-convert-docxodt-to-pdfhtml-with-java/
For who it may concern !!!

<Error>: FT_Open_Face failed: error 85

I am trying to install a custom font into my iPhone application. When I add the 'Fonts provided by application’ key into my info.plist file I get the following error ': FT_Open_Face failed: error 85.’
I am not sure what the problem is as I have successfully been able to use custom fonts in the past.
Any help will be appreciated.
If you leave the first element in your font array in the plist (index 0) blank, you will get this error.
PostScript fonts cannot be used with UIFont directly. You can use them only with CoreText or CATextLayer.
This can occur if the font in question is a Font Suitcase format. Open your application package, and if the font .ttf file shows a size of "Zero bytes", it's probably a font suitcase.
Files of this type can be converted using Fondu.
When running Fondu, I had to specify not just the suitcase file, but the resource fork inside it:
fondu mysuitcasefont.ttf/..namedfork/rsrc
This will extract any fonts in the suitcase to the current directory. It is these extracted files you will want to include in your iOS project and reference from the .plist.
I received this error when using a .ttf font. I was able to correct it by removing the file extension from the filename in (a) the resource in xcode and (b) the "Fonts provided by application" array in the .plist file.
Hopefully this will help.
I was trying to use Google Signika font on my App, and got the exact issue.
I solve the issue by using the .otf version of the font
Accepted answer is totally wrong and unnecessary. Probably you made a mistake when writing your font name.
Thats rules for that.
First Step : Write font name before .ttf extension. Example: For FFFTusj.ttf => FFFTusj
Second Step : Write - and after font style. Example: Bold or Medium etc. Example: #"FFFTusj-Bold"
And also dont forget add your font file to your project.
Check this link:
http://www.bycoder.com/post/2013/03/28/XCode-Custom-font-doesnt-work
If your font is REGULAR dont write -Regular at end of font name.

Special characters in iText

I need help in using these symbols ⎕, ∨, ๐, Ʌ, and so on. But when I create a PDF with iText these symbols do not appear.
What can I do so that these symbols appear?
You have to use a font and encoding that contains those characters. Your best bet is to use IDENTITY_H for your encoding, as this grants you access to every character within a given font... but you still have to use the right font.
There are several font-manipulation examples within "iText in Action's" chapter on fonts:
http://www.itextpdf.com/book/chapter.php?id=11
The examples are down the right side. Buying the book would probably help too.
I had the same problem too and I figured out using IDENTITY_H for encoding is working fine.
For example:
java.awt.Font f =...;
Font font = FontFactory.getFont(f.getName(),BaseFont.IDENTITY_H)
I don't understand why with BaseFont.WINANSI it doesn't work. Winansi is the standard Windows Cp1252 character set, that one used by my JVM. So, if the char is correctly displayed in Java, why it is not the case for PDF?
You can escape them according to the unicode escape sequence defined in the java language specification. See http://java.sun.com/docs/books/jls/first_edition/html/3.doc.html
If you are using IntelliJ IDEA for your code you can download the StringManipulation plugin, that does the escapes for you. In the settings of IDEA you can also set the "Transparent native-to-ascii conversion" checkbox under File encodings, and this should help do the trick.
square in pdf file by iText:
BaseFont bf = BaseFont.createFont("c:/windows/fonts/arialbd.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
question.add(new Phrase("\u25A1", new Font(bf, 26)));
You can see a pdf file exemple here