Gnostice PDFOne
Pro. Ed. v5.0.0


com.gnostice.pdfone
Class PdfViewerPageDisplaySettings

java.lang.Object
  extended bycom.gnostice.pdfone.PdfViewerPageDisplaySettings

public final class PdfViewerPageDisplaySettings
extends Object

This class represents default settings that can be set for a PDF viewer component before it loads a document.

The PdfViewer.getPageDisplaySettings() method returns an instance of this class. Use the methods of that instance to read or modify the settings.

To change default settings of a viewer, call the PdfViewer.setPageDisplaySettings(PdfViewerPageDisplaySettings pageDisplaySettings) method with the PdfViewerPageDisplaySettings instance whose settings have been modified.

The new settings will be used when the viewer component loads another document. Do not expect changes to default settings to affect viewer display in real time. PdfViewer class provides a different set of methods for such purposes.


Constructor Summary
PdfViewerPageDisplaySettings()
          Zero-argument default constructor.
 
Method Summary
 int getDpi()
          Returns DPI (dot per inch) set for the viewer component.
 Insets getGapsBetweenPages()
          Returns current insets (margins or separation) around the pages displayed in the viewer.
 int getPageColumnsCustomCount()
          Returns maximum number of pages that the viewer component is set to display in a row.
 int getPageLayout()
          Returns page layout setting for the viewer component.
 int getPageView()
          Returns how viewer component is set to fit pages within its display area.
 boolean isPageLayoutInitAsPerDoc()
          Returns whether layout settings of the viewer are set to be as specified in the document that is displayed.
 boolean isShowCoverPageDuringSideBySide()
          Specifies whether the viewer component is set to display the first page singly.
 boolean isShowGapsBetweenPages()
          Specifies whether the viewer displays spaces around pages when it displays a document.
 boolean isShowPageBordersWhenNoPageGaps()
          Returns whether the viewer component needs to draw page borders when it displays no insets around the pages.
 void loadSettings(File inputFile)
          Loads viewer display settings from a properties file.
 void loadSettings(InputStream inputStream)
          Loads viewer display settings from a properties file specified by a stream.
 void reset()
           
 void saveSettings(File outputFile)
          Saves viewer display settings to a properties file.
 void saveSettings(OutputStream outputStream)
          Saves viewer display settings to a properties file specified by a stream.
 void setDpi(int dpi)
          Sets specified DPI for the viewer component.
 void setGapsBetweenPages(Insets gapsBetweenPages)
          Set insets (margins or separation) that the viewer component needs to use when it displays pages in a document.
 void setPageColumnsCustomCount(int pageColumnsCustomCount)
          Sets specified maximum number of pages that the viewer component needs display in a row.
 void setPageLayout(int pageLayout)
          Sets specified page layout setting for the viewer component.
 void setPageLayoutInitAsPerDoc(boolean isPageLayoutInitAsPerDoc)
          Sets whether layout settings of the viewer need to be set as specified in the document that is displayed.
 void setPageView(int pageView)
          Sets how viewer component fits pages within its display area.
 void setShowCoverPageDuringSideBySide(boolean showCoverPageDuringSideBySide)
          Sets whether the viewer component is set to display the first page singly.
 void setShowGapsBetweenPages(boolean showGapsBetweenPages)
          Makes the viewer component display spaces around page when it displays a document.
 void setShowPageBordersWhenNoPageGaps(boolean showPageBordersWhenNoPageGaps)
          Sets whether viewer component needs to draw page borders when it displays no insets around the pages.
 void showPageDisplaySettingsDialog(boolean isModal)
          Displays a modal/non-modal dialog box for allowing the user to specify page display settings.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PdfViewerPageDisplaySettings

public PdfViewerPageDisplaySettings()
Zero-argument default constructor.

Method Detail

showPageDisplaySettingsDialog

public void showPageDisplaySettingsDialog(boolean isModal)
Displays a modal/non-modal dialog box for allowing the user to specify page display settings.

Parameters:
isModal - whether the dialog box is modal

reset

public void reset()

loadSettings

public void loadSettings(File inputFile)
                  throws PdfException,
                         IOException
Loads viewer display settings from a properties file.

Parameters:
inputFile - pathname of the file
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

loadSettings

public void loadSettings(InputStream inputStream)
                  throws IOException,
                         PdfException
Loads viewer display settings from a properties file specified by a stream.

Parameters:
inputStream - stream containing the properties file
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.
See Also:
saveSettings(OutputStream)

saveSettings

public void saveSettings(File outputFile)
                  throws IOException,
                         PdfException
Saves viewer display settings to a properties file.

Parameters:
outputFile - pathname of the file
Throws:
PdfException - if an illegal argument is supplied.
IOException - if an I/O error occurs.

saveSettings

public void saveSettings(OutputStream outputStream)
                  throws IOException
Saves viewer display settings to a properties file specified by a stream.

Parameters:
outputStream - stream containing the properties file
Throws:
IOException - if an I/O error occurs.
See Also:
loadSettings(InputStream)

getDpi

public int getDpi()
Returns DPI (dot per inch) set for the viewer component.

Returns:
constant representing the current DPI of the viewer component
See Also:
setDpi(int)

setDpi

public void setDpi(int dpi)
            throws PdfException
Sets specified DPI for the viewer component.

Parameters:
dpi - constant representing the DPI that needs to be set for the viewer component
Throws:
PdfException - if an illegal argument is supplied.
See Also:
getDpi()

isPageLayoutInitAsPerDoc

public boolean isPageLayoutInitAsPerDoc()
Returns whether layout settings of the viewer are set to be as specified in the document that is displayed.

Returns:
true if layout settings specified in the document are set to be used. false if viewer defaults are used.
See Also:
setPageLayoutInitAsPerDoc(boolean)

setPageLayoutInitAsPerDoc

public void setPageLayoutInitAsPerDoc(boolean isPageLayoutInitAsPerDoc)
Sets whether layout settings of the viewer need to be set as specified in the document that is displayed.

Parameters:
isPageLayoutInitAsPerDoc - true if settings specified in the document need to be used. false if viewer defaults need to be used.
See Also:
isPageLayoutInitAsPerDoc()

getPageColumnsCustomCount

public int getPageColumnsCustomCount()
Returns maximum number of pages that the viewer component is set to display in a row. By default, this setting is set to 1.

Returns:
number of pages in a row
See Also:
setPageColumnsCustomCount(int)

setPageColumnsCustomCount

public void setPageColumnsCustomCount(int pageColumnsCustomCount)
Sets specified maximum number of pages that the viewer component needs display in a row. By default, this setting is set to 1. If the JRE version is 1.4 or lesser, then the maximum number will be limited to 512. Otherwise, there is no limit.

Parameters:
pageColumnsCustomCount - number of pages in a row
See Also:
getPageColumnsCustomCount()

getPageLayout

public int getPageLayout()
Returns page layout setting for the viewer component. By default, this setting is set to PdfViewer.LAYOUT_SINGLE_PAGE_CONTINUOUS.

Returns:
constant specifying layout setting
See Also:
setPageLayout(int)

setPageLayout

public void setPageLayout(int pageLayout)
                   throws PdfException
Sets specified page layout setting for the viewer component. By default, this setting is set to PdfViewer.LAYOUT_SINGLE_PAGE_CONTINUOUS.

Parameters:
pageLayout - constant specifying layout setting
Throws:
PdfException - if an illegal argument is supplied.
See Also:
getPageLayout()

getGapsBetweenPages

public Insets getGapsBetweenPages()
Returns current insets (margins or separation) around the pages displayed in the viewer. By default, the insets are set to 5.

Returns:
current insets around the pages displayed in the viewer
See Also:
setGapsBetweenPages(Insets)

setGapsBetweenPages

public void setGapsBetweenPages(Insets gapsBetweenPages)
Set insets (margins or separation) that the viewer component needs to use when it displays pages in a document. By default, the insets are set to 4.

Parameters:
gapsBetweenPages - insets that viewer needs to use when displaying pages from a document
See Also:
getGapsBetweenPages()

isShowGapsBetweenPages

public boolean isShowGapsBetweenPages()
Specifies whether the viewer displays spaces around pages when it displays a document. By default, this setting is set to true.

Returns:
whether the viewer displays spaces around pages
See Also:
setShowGapsBetweenPages(boolean)

setShowGapsBetweenPages

public void setShowGapsBetweenPages(boolean showGapsBetweenPages)
Makes the viewer component display spaces around page when it displays a document. By default, this setting is set to true.

Parameters:
showGapsBetweenPages -
See Also:
isShowGapsBetweenPages()

isShowPageBordersWhenNoPageGaps

public boolean isShowPageBordersWhenNoPageGaps()
Returns whether the viewer component needs to draw page borders when it displays no insets around the pages. By default, this setting is set to true.

Returns:
whether the viewer component needs to draw page borders when it displays no no insets around the pages.
See Also:
setShowPageBordersWhenNoPageGaps(boolean)

setShowPageBordersWhenNoPageGaps

public void setShowPageBordersWhenNoPageGaps(boolean showPageBordersWhenNoPageGaps)
Sets whether viewer component needs to draw page borders when it displays no insets around the pages. By default, this setting is set to true.

Parameters:
showPageBordersWhenNoPageGaps - whether viewer component needs to draw page borders when it displays no insets around the pages.
See Also:
isShowPageBordersWhenNoPageGaps()

isShowCoverPageDuringSideBySide

public boolean isShowCoverPageDuringSideBySide()
Specifies whether the viewer component is set to display the first page singly. By default, this setting is set to false.

Returns:
whether the viewer component is set to display the first page singly
See Also:
setShowCoverPageDuringSideBySide(boolean)

setShowCoverPageDuringSideBySide

public void setShowCoverPageDuringSideBySide(boolean showCoverPageDuringSideBySide)
Sets whether the viewer component is set to display the first page singly. By default, this setting is set to false.

Parameters:
showCoverPageDuringSideBySide - whether the viewer component is set to display the first page singly.
See Also:
isShowCoverPageDuringSideBySide()

getPageView

public int getPageView()
Returns how viewer component is set to fit pages within its display area. Default value for this setting is PdfViewer.PAGEVIEW_ACTUAL_SIZE.

Returns:
constant specify the fit style
See Also:
setPageView(int)

setPageView

public void setPageView(int pageView)
Sets how viewer component fits pages within its display area. Default value for this setting is PdfViewer.PAGEVIEW_ACTUAL_SIZE.

Parameters:
pageView - constant specify the fit style
See Also:
getPageView()

Gnostice PDFOne
Pro. Ed. v5.0.0

To contact our support team, send an e-mail to support@gnostice.com.
 
© 2010 Gnostice Information Technologies Private Limited. All rights reserved.
www.gnostice.com