iText 7 font examples

iText 7 font examples, including: colored text, Czech example, examples Font Tutorial, language-specific examples, reuse a font from an existing PDF, showing special characters, type 3 font, unembed a font, using fonts, ... How to make a single letter bold within a word? How to apply color to Strings in a Paragraph? How to use Cyrillic characters in a PDF? How to display indian rupee symbol? Why isn't the Rupee symbol showing? How to print mathematical characters like ∈, ∩, ∑, ∫, ∆ √, ∠?

Tags: fontsencodinglanguagesiText 7
These examples were written in the context of the tutorial Using fonts in PDF and iText .
I am implementing a PdfPageEventHelper event to add a footer as shown in this code snippet: ColumnText. showTextAligned ( cb, Element . ALIGN_RIGHT , new Phrase ( String . format ( " %d " , writer. getPageNumber ( ) ) , footerFont ) , document. right ( ) - 2 , document. bottom ( ) - 20 , 0 ) ; I need to add 3 lines, but I don't find how to calculate the distance between the lines. Each line has different font size. What should I use as XXX value in document.bottom() - XXX ?
My Code: public static final String[] tempString = { "KozMinPro-Regular.otf", "UniJIS-UCS2-H", pharseString }; bf = BaseFont.createFont(tempString[0], tempString[1], BaseFont.NOT_EMBEDDED); The exception: java.nio.charset.UnsupportedCharsetException: UniJIS-UCS2-H at java.nio.charset.Charset.forName(Unknown Source) at com.itextpdf.text.pdf.PdfEncodings.convertToBytes(
If I say: var georgia = FontFactory.GetFont("Georgia Regular", 10f); it doesn't work. When I check the state of the variable georgia, it has its Family property set to the value UNDEFINED and its FamilyName property set to Unknown . It only works if I actually load and register the font file.
I want to put a check mark using Zapfdingbats on a specific location in my PDF document. What I achieved so far is this: I can show the check mark but it's on the side of the document and not on the specific X, Y coordinate that I want it to be.
I am generating PDF files from XML data. I calculate the height of a paragraph element like this: float paraWidth = 0.0f; for (Object o : el.getChunks()) { paraWidth += ((Chunk) o).getWidthPoint(); } float paraHeight = paraWidth/PageSize.A4.getWidth(); But this method does not works correctly.
I want to create a table with a little headline, "Company name" for example, where the text should be a little smaller than the rest of the text. Currently I'm using cells and was wondering if I can use 2 different font sizes within the same cell?
I have an application, that extracts headings out of pdf files. The documents that the application is supposed to work with, all have more or less coherent structure and formatting. In fact, telling if a text chunk is bold or not, is very important.
I'm trying to extract and print English text out of a PDF on the console. Extraction is done through iText's PdfTextExtractor class. The text I'm getting is not understandable.