Example usage for com.lowagie.text.pdf PdfWriter setInitialLeading

List of usage examples for com.lowagie.text.pdf PdfWriter setInitialLeading

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfWriter setInitialLeading.

Prototype

public void setInitialLeading(float leading) throws DocumentException 

Source Link

Document

Sets the initial leading for the PDF document.

Usage

From source file:questions.images.CustomizedTitleBar.java

public static void main(String[] args) throws IOException, DocumentException {
    Document document = new Document();
    PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
    writer.setInitialLeading(18);
    document.open();//from ww  w.jav a 2 s.  com

    Image button = Image.getInstance(RESOURCE);
    document.add(getTitleBar(writer, button, "My first title"));
    for (int i = 0; i < 20; i++)
        document.add(new Paragraph("Some text: " + i));
    document.add(getTitleBar(writer, button, "My second title"));
    for (int i = 0; i < 10; i++)
        document.add(new Paragraph("Some text: " + i));
    document.newPage();
    document.add(getTitleBar(writer, button, "My third title"));
    for (int i = 0; i < 10; i++)
        document.add(new Paragraph("Some text: " + i));

    document.close();
}