PdfWriter.PageModeUseOutlines | PdfWriter.PageLayoutTwoColumnRight : Viewer Preferences « PDF « Java Tutorial






import java.io.FileOutputStream;

import com.lowagie.text.Document;
import com.lowagie.text.PageSize;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfWriter;

public class MainClass {

  public static void main(String[] args) throws Exception {
    Document document = new Document();
    PdfWriter writer1 = PdfWriter.getInstance(document, new FileOutputStream(
        "2.pdf"));
    writer1
        .setViewerPreferences(PdfWriter.PageModeUseOutlines | PdfWriter.PageLayoutTwoColumnRight);
    document.open();
    PdfWriter writer2 = PdfWriter.getInstance(document, new FileOutputStream("full_screen.pdf"));
    writer2.setViewerPreferences(PdfWriter.PageModeFullScreen
        | PdfWriter.NonFullScreenPageModeUseOutlines);
    document.open();
    
    document.setPageSize(PageSize.A4.rotate());
    document.add(new Paragraph("adf"));
    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