Example usage for com.itextpdf.text.pdf PdfTransition PdfTransition

List of usage examples for com.itextpdf.text.pdf PdfTransition PdfTransition

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfTransition PdfTransition.

Prototype

public PdfTransition(int type, int duration) 

Source Link

Document

Constructs a Transition.

Usage

From source file:org.sejda.impl.itext5.component.PdfStamperHandler.java

License:Open Source License

/**
 * Applies the given transition to the given page.
 * //from   w w w .  ja  va2  s .  c  om
 * @param page
 * @param transition
 */
public void setTransition(Integer page, PdfPageTransition transition) {
    Integer transitionStyle = getTransition(transition.getStyle());
    if (transitionStyle != null) {
        stamper.setDuration(transition.getDisplayDuration(), page);
        stamper.setTransition(new PdfTransition(transitionStyle, transition.getTransitionDuration()), page);
    } else {
        LOG.warn("Transition {} not applied to page {}. Not supported by iText.", transition.getStyle(), page);
    }
}