Example usage for com.lowagie.text Paragraph setMultipliedLeading

List of usage examples for com.lowagie.text Paragraph setMultipliedLeading

Introduction

In this page you can find the example usage for com.lowagie.text Paragraph setMultipliedLeading.

Prototype

public void setMultipliedLeading(float multipliedLeading) 

Source Link

Document

Sets the variable leading.

Usage

From source file:org.tellervo.desktop.print.BasicBoxLabel.java

License:Open Source License

/**
 * Get an iText Paragraph for the Title 
 * /*from  w w w.ja v  a  2 s. co m*/
 * @return Paragraph
 */
private Paragraph getTitlePDF(WSIBox b) {
    Paragraph p = new Paragraph();
    p.setLeading(0f);
    p.setMultipliedLeading(1.2f);
    p.add(new Phrase(10, b.getTitle() + "\n", monsterFont));
    p.add(new Phrase(10, b.getComments() + " " + App.getLabName()
            + "fdas dfsa fds sdfalkdsf jlasdj fkljkldsa jfdsklaj fdksaj flkdsaj lkfdsalk fjdsal fjdklaj fkldsajkldsfalkjsdf asdlkj dsajlk",
            bodyFont));

    //p.add(new Chunk(b.getCurationLocation(), bodyFontLarge));

    return p;
}

From source file:questions.objects.DifferentLeadings.java

public static void main(String[] args) {
    Document document = new Document(PageSize.A7);
    try {/*w  w  w  . ja v  a2s. c o  m*/
        PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();
        Chunk space = new Chunk(' ');
        String text = "Quick brown fox jumps over the lazy dog.";
        Phrase phrase1 = new Phrase(text, new Font(Font.HELVETICA, 12));
        Phrase phrase2 = new Phrase(new Chunk(text, new Font(Font.TIMES_ROMAN, 24)));
        Phrase phrase3 = new Phrase(text, new Font(Font.COURIER, 8));
        Phrase phrase4 = new Phrase(text, new Font(Font.HELVETICA, 4));
        Paragraph paragraph = new Paragraph();
        paragraph.add(phrase1);
        paragraph.add(space);
        paragraph.add(phrase2);
        paragraph.add(space);
        paragraph.add(phrase3);
        paragraph.add(space);
        paragraph.add(phrase4);
        paragraph.setMultipliedLeading(1.5f);
        paragraph.setAlignment(Element.ALIGN_JUSTIFIED);
        ColumnText column = new ColumnText(writer.getDirectContent());
        column.setSimpleColumn(document.left(), document.bottom(), document.right(), document.top());
        column.addElement(paragraph);
        column.go();
        document.newPage();
        document.add(paragraph);
    } catch (DocumentException de) {
        System.err.println(de.getMessage());
    } catch (IOException ioe) {
        System.err.println(ioe.getMessage());
    }
    document.close();
}