Adding Chunk to Paragraph : Paragraph « PDF RTF « Java






Adding Chunk to Paragraph

Adding Chunk to Paragraph
import java.io.FileOutputStream;

import com.lowagie.text.Chunk;
import com.lowagie.text.Document;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;

public class AddingChunkToParagraphPDF {
  public static void main(String[] args) {
    try {
      Document document = new Document();
      PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("AddingChunkToParagraphPDF.pdf"));
      document.open();
      Paragraph p = new Paragraph();
      p.add(new Chunk("Font.TIMES_ROMAN", new Font(Font.TIMES_ROMAN, 12)));
      document.add(new Paragraph(p));

      document.close();
    } catch (Exception de) {
      de.printStackTrace();
    }
  }
}

           
       








itext.zip( 1,748 k)

Related examples in the same category

1.Three ParagraphsThree Paragraphs
2.Adding List to Paragraph
3.Adding Chunk and Phrase to ParagraphAdding Chunk and Phrase to Paragraph
4.Long Paragraph in PDFLong Paragraph in PDF
5.Generates a simple 'Hello World' PDF fileGenerates a simple 'Hello World' PDF file
6.Adding Paragraph to a PageAdding Paragraph to a Page