PdfWriter.PageLayoutOneColumn : Viewer Preferences « PDF « Java Tutorial






import java.io.FileOutputStream;

import com.lowagie.text.Document;
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 writer2 = PdfWriter.getInstance(document, new FileOutputStream("one_column.pdf"));
    writer2.setViewerPreferences(PdfWriter.PageLayoutOneColumn);

    document.open();
    Paragraph hello = new Paragraph("(English:) hello, ");
    document.add(new Paragraph("asdf"));
    document.add(hello);
    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