Adding Chunk to a Phrase : Phrase « PDF RTF « Java






Adding Chunk to a Phrase

Adding Chunk to a Phrase
import java.io.FileOutputStream;

import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Phrase;
import com.lowagie.text.pdf.PdfWriter;

public class PhraseInaChunkPDF {
  public static void main(String[] args) {
    Document document = new Document();
    try {
      PdfWriter.getInstance(document, new FileOutputStream("PhraseInaChunkPDF.pdf"));

      document.open();

      Phrase phrase = new Phrase(new Chunk("this is a phrase in a chunk\n"));
      document.add(phrase);
    } catch (Exception ioe) {
      System.err.println(ioe.getMessage());
    }
    document.close();
  }
}
           
       








itext.zip( 1,748 k)

Related examples in the same category

1.Phrase with Color red and Normal FontPhrase with Color red and Normal Font
2.Phrase with Leading LinePhrase with Leading Line
3.Phrase with Several Chunks and Different Fonts