本文整理汇总了Java中com.lowagie.text.pdf.PdfWriter.PageModeUseOutlines方法的典型用法代码示例。如果您正苦于以下问题:Java PdfWriter.PageModeUseOutlines方法的具体用法?Java PdfWriter.PageModeUseOutlines怎么用?Java PdfWriter.PageModeUseOutlines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.lowagie.text.pdf.PdfWriter
的用法示例。
在下文中一共展示了PdfWriter.PageModeUseOutlines方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addToCatalog
import com.lowagie.text.pdf.PdfWriter; //导入方法依赖的package包/类
/**
* Adds the viewer preferences defined in the preferences parameter to a
* PdfDictionary (more specifically the root or catalog of a PDF file).
*
* @param catalog
*/
public void addToCatalog(PdfDictionary catalog) {
// Page Layout
catalog.remove(PdfName.PAGELAYOUT);
if ((pageLayoutAndMode & PdfWriter.PageLayoutSinglePage) != 0)
catalog.put(PdfName.PAGELAYOUT, PdfName.SINGLEPAGE);
else if ((pageLayoutAndMode & PdfWriter.PageLayoutOneColumn) != 0)
catalog.put(PdfName.PAGELAYOUT, PdfName.ONECOLUMN);
else if ((pageLayoutAndMode & PdfWriter.PageLayoutTwoColumnLeft) != 0)
catalog.put(PdfName.PAGELAYOUT, PdfName.TWOCOLUMNLEFT);
else if ((pageLayoutAndMode & PdfWriter.PageLayoutTwoColumnRight) != 0)
catalog.put(PdfName.PAGELAYOUT, PdfName.TWOCOLUMNRIGHT);
else if ((pageLayoutAndMode & PdfWriter.PageLayoutTwoPageLeft) != 0)
catalog.put(PdfName.PAGELAYOUT, PdfName.TWOPAGELEFT);
else if ((pageLayoutAndMode & PdfWriter.PageLayoutTwoPageRight) != 0)
catalog.put(PdfName.PAGELAYOUT, PdfName.TWOPAGERIGHT);
// Page Mode
catalog.remove(PdfName.PAGEMODE);
if ((pageLayoutAndMode & PdfWriter.PageModeUseNone) != 0)
catalog.put(PdfName.PAGEMODE, PdfName.USENONE);
else if ((pageLayoutAndMode & PdfWriter.PageModeUseOutlines) != 0)
catalog.put(PdfName.PAGEMODE, PdfName.USEOUTLINES);
else if ((pageLayoutAndMode & PdfWriter.PageModeUseThumbs) != 0)
catalog.put(PdfName.PAGEMODE, PdfName.USETHUMBS);
else if ((pageLayoutAndMode & PdfWriter.PageModeFullScreen) != 0)
catalog.put(PdfName.PAGEMODE, PdfName.FULLSCREEN);
else if ((pageLayoutAndMode & PdfWriter.PageModeUseOC) != 0)
catalog.put(PdfName.PAGEMODE, PdfName.USEOC);
else if ((pageLayoutAndMode & PdfWriter.PageModeUseAttachments) != 0)
catalog.put(PdfName.PAGEMODE, PdfName.USEATTACHMENTS);
// viewer preferences (Table 8.1 of the PDF Reference)
catalog.remove(PdfName.VIEWERPREFERENCES);
if (viewerPreferences.size() > 0) {
catalog.put(PdfName.VIEWERPREFERENCES, viewerPreferences);
}
}