Example usage for org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline PDOutlineItem setItalic

List of usage examples for org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline PDOutlineItem setItalic

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline PDOutlineItem setItalic.

Prototype

public void setItalic(boolean italic) 

Source Link

Document

Set the italic property of the text.

Usage

From source file:org.pdfsam.pdfbox.component.PDFBoxOutlineUtils.java

License:Open Source License

/**
 * Copies the dictionary from the given {@link PDOutlineItem} to the destination one
 * //from w ww .  j a  v  a2 s  .c  o m
 * @param from
 * @param to
 */
public static void copyOutlineDictionary(PDOutlineItem from, PDOutlineItem to) {
    to.setTitle(from.getTitle());
    to.setTextColor(from.getTextColor());
    to.setBold(from.isBold());
    to.setItalic(from.isItalic());
    if (from.isNodeOpen()) {
        to.openNode();
    } else {
        to.closeNode();
    }
}

From source file:org.pdfsam.pdfbox.component.PDFBoxOutlineUtilsTest.java

License:Open Source License

@Test
public void copyDictionary() {
    PDOutlineItem from = new PDOutlineItem();
    from.setBold(true);/*from  ww  w  .ja  v a  2 s .  c om*/
    from.setItalic(true);
    from.setTitle("Chuck");
    PDOutlineItem to = new PDOutlineItem();
    to.setBold(false);
    to.setItalic(false);
    PDFBoxOutlineUtils.copyOutlineDictionary(from, to);
    assertTrue(to.isBold());
    assertTrue(to.isItalic());
    assertEquals("Chuck", to.getTitle());
}