A chunk is the smallest significant part that can be added to a document. A chunk is a string with Font information. Chunk reportTitle= new Chunk(“Candidate Login Report “,catFont); Chunk add multiple Chunk and Phrase in itextpdf package ; import When I created iText, I chose the word chunk for the atomic text element because of its first definition in my dictionary: “a solid piece.” A phrase, on the other hand.

Author: Darr Kazrara
Country: Guatemala
Language: English (Spanish)
Genre: Marketing
Published (Last): 5 March 2016
Pages: 357
PDF File Size: 8.44 Mb
ePub File Size: 5.28 Mb
ISBN: 464-9-67824-343-2
Downloads: 71443
Price: Free* [*Free Regsitration Required]
Uploader: Gujar

Actually, the line can be anywhere vertically and has always the Chunk width. Note that we are looking at the same document, on the same OS Ubuntu Linuxyet the names of the directors in the document look slightly different because different fonts were used. A positive value will be added to the left margin of the document; a negative value will be subtracted. The method createDirectorPhrase from listing 2. A positive value simulates superscript; a negative value simulates subscript.

Java IText: Chunk

You define a different font size 6 pt and set the font color to white. Closeand I have to shut down VS to release its hold on the document object. If he wants you to switch from Helvetica to Times, you have to change your code in only one place. IAccessibleElement Itdxt the role of the accessible element.


A chunk is a String with a certain Font. Chunks have no concept of how to force a new.

All other layout parameters should be defined in the object to which this chunk of text is added. FAQ What is the default leading in iText?

Element Checks if this element is a content object. You tell iText where to find the font programs for Times New Roman times.

As with the Label, you need to be careful how you use Chunks. The object that you will use most often is a Paragraph, which is a sequence of Phrases and Chunks held together. If you look at the HSQL script filmfestival.

Chunk (iText API)

You really answered yourself in your comment. If not, it’s a metadata object. Finallylisting 2. Get Started with Astyanax, the Cassandra java library by Netflix.

What we have seen so far is the very basic building blocks for text in PDFs. The default font in iText is Helvetica with size 12 pt. The first block of text, which is -quoted, or a verbatim string literal, needs to have all the whitespace and newlines removed from it, otherwise it will appear with them preserved in the resulting PDF. A PDF document cunk be cbunk and printed on any platform: The createMovieInformation method from listing 2. Not embedding fonts is chknk a risk, especially if you need special glyphs in your document.

It may be null.


The setBackground method draws a colored rectangle behind the text contained in the Chunk. That comment shows that you’re trying to solve the problem yourself. Note cyunk all child elements won’t also be tagged. The meaning of these options will be explained in table For the default font—with a default size of 12—the default leading is ltext You can set the leading or font as part of initiating a new phrase, as well as pass it a string or chunk to set its content through the phrase’s various overloaded constructors.

It achieves this by introducing a dummy Paragraph with a negative leading, causing the current position on the page to move one line up. Instead, the default leading is used.

NewLine”courier. A little explanation would be nice.

Chunk examples

The text for this tag can be retrieved with PdfPageEvent. Of course, you should always use try It can be PdfContentByte. Adobe Reader on Ubuntu see the left cjunk in figure 2.

The space between each line actually the measurement taken between the baselines of each line, or “leading” is 1.