Java Code Examples for com.lowagie.text.pdf.PdfWriter#PageModeFullScreen

The following examples show how to use com.lowagie.text.pdf.PdfWriter#PageModeFullScreen . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PdfViewerPreferencesImp.java    From gcs with Mozilla Public License 2.0 5 votes vote down vote up
/**
 * 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);
	}
}
 
Example 2
Source File: PdfViewerPreferencesImp.java    From itext2 with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * 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);
	}
}