Slide Show : Viewer Preferences « PDF « Java Tutorial






import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.Image;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.PdfTransition;
import com.lowagie.text.pdf.PdfWriter;

public class MainClass {
  public static void main(String[] args) throws Exception {
    Document document = new Document(new Rectangle(144, 115));
    PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("2.pdf"));
    writer.setPdfVersion(PdfWriter.VERSION_1_5);
    writer.setViewerPreferences(PdfWriter.PageModeFullScreen);
    document.open();

    Image img0 = Image.getInstance("0.gif");
    img0.setAbsolutePosition(0, 0);
    writer.setTransition(new PdfTransition(PdfTransition.OUTBOX, 3));
    document.add(img0);
    document.newPage();

    Image img1 = Image.getInstance("1.gif");
    img1.setAbsolutePosition(0, 0);
    writer.setTransition(new PdfTransition(PdfTransition.INBOX, 2));
    writer.setDuration(1);
    document.add(img1);
    document.newPage();

    document.close();
  }
}








29.29.Viewer Preferences
29.29.1.PdfWriter.PageModeUseOutlines | PdfWriter.PageLayoutTwoColumnRight
29.29.2.Page Labels
29.29.3.Slide Show
29.29.4.PdfWriter.HideMenubar | PdfWriter.CenterWindow
29.29.5.PdfWriter.HideWindowUI | PdfWriter.FitWindow
29.29.6.display title, two page left
29.29.7.PdfWriter.HideToolbar | PdfWriter.PageModeUseThumbs
29.29.8.Set Viewer Preferences
29.29.9.PdfWriter.PageLayoutOneColumn
29.29.10.PdfWriter.PageLayoutTwoColumnLeft
29.29.11.PdfWriter.PageLayoutTwoColumnRight
29.29.12.PdfWriter.PageLayoutTwoPageLeft
29.29.13.PdfWriter.PageLayoutTwoPageRight