Class PDFDocViewPrefs
PDFDocViewPrefs is a high-level utility class that can be used to control the way the document is to be presented on the screen or in print.
PDFDocViewPrefs class corresponds to PageMode, PageLayout, and ViewerPreferences entries in the document's catalog. For more details please refer to section 8.1 'Viewer Preferences' in PDF Reference Manual.
Implements
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public class PDFDocViewPrefs : IDisposable
Methods
Dispose()
Releases all resources used by the PDFDocViewPrefs
Declaration
public override sealed void Dispose()
Dispose(bool)
Declaration
[HandleProcessCorruptedStateExceptions]
protected virtual void Dispose(bool A_0)
Parameters
Type | Name | Description |
---|---|---|
bool | A_0 |
~PDFDocViewPrefs()
Allows a PDFDocViewPrefs to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
Declaration
protected ~PDFDocViewPrefs()
GetDirection()
Gets the direction.
Declaration
public bool GetDirection()
Returns
Type | Description |
---|---|
bool | true is the predominant reading order for text is left to right, false otherwise. See SetDirection() for more information. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetLayoutMode()
Gets the layout mode.
Declaration
public PDFDocViewPrefs.PageLayout GetLayoutMode()
Returns
Type | Description |
---|---|
PDFDocViewPrefs.PageLayout | The value of currently selected PageLayout property. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetNonFullScreenPageMode()
Gets the non full screen page mode.
Declaration
public PDFDocViewPrefs.PageMode GetNonFullScreenPageMode()
Returns
Type | Description |
---|---|
PDFDocViewPrefs.PageMode | the PageMode used after exiting full-screen mode. |
Remarks
This entry is meaningful only if the value of the PageMode is set to e_FullScreen; it is ignored otherwise.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPageMode()
Gets the page mode.
Declaration
public PDFDocViewPrefs.PageMode GetPageMode()
Returns
Type | Description |
---|---|
PDFDocViewPrefs.PageMode | The value of currently selected PageMode property. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPref(ViewerPref)
Gets the pref.
Declaration
public bool GetPref(PDFDocViewPrefs.ViewerPref pref)
Parameters
Type | Name | Description |
---|---|---|
PDFDocViewPrefs.ViewerPref | pref | the ViewerPref property type to query. |
Returns
Type | Description |
---|---|
bool | the value of given ViewerPref property. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPrintArea()
Gets the prints the area.
Declaration
public Page.Box GetPrintArea()
Returns
Type | Description |
---|---|
Page.Box | the page boundary representing the area of a page to be rendered when printing the document. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPrintClip()
Gets the prints the clip.
Declaration
public Page.Box GetPrintClip()
Returns
Type | Description |
---|---|
Page.Box | the page boundary to which the contents of a page are to be clipped when printing the document. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetSDFObj()
Gets the SDFObj.
Declaration
public Obj GetSDFObj()
Returns
Type | Description |
---|---|
Obj | document's SDF/Cos 'ViewerPreferences' dictionary or NULL if the object is not present. |
GetViewArea()
Gets the view area.
Declaration
public Page.Box GetViewArea()
Returns
Type | Description |
---|---|
Page.Box | the page boundary representing the area of a page to be displayed when viewing the document on the screen. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetViewClip()
Gets the view clip.
Declaration
public Page.Box GetViewClip()
Returns
Type | Description |
---|---|
Page.Box | the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetDirection(bool)
Sets the predominant reading order for text.
This flag has no direct effect on the document's contents or page numbering but can be used to determine the relative positioning of pages when displayed side by side or printed n-up.
Declaration
public void SetDirection(bool left_to_right)
Parameters
Type | Name | Description |
---|---|---|
bool | left_to_right |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetInitialPage(Destination)
Declaration
public void SetInitialPage(Destination dest)
Parameters
Type | Name | Description |
---|---|---|
Destination | dest |
SetLayoutMode(PageLayout)
Sets PageLayout property and change the value of the PageLayout key in the Catalog dictionary.
Declaration
public void SetLayoutMode(PDFDocViewPrefs.PageLayout layout)
Parameters
Type | Name | Description |
---|---|---|
PDFDocViewPrefs.PageLayout | layout | the new layout mode |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetNonFullScreenPageMode(PageMode)
Set the document's page mode, specifying how to display the document on exiting full-screen mode.
Declaration
public void SetNonFullScreenPageMode(PDFDocViewPrefs.PageMode mode)
Parameters
Type | Name | Description |
---|---|---|
PDFDocViewPrefs.PageMode | mode | PageMode used after exiting full-screen mode. Default value: e_UseNone. |
Remarks
This entry is meaningful only if the value of the PageMode is set to e_FullScreen; it is ignored otherwise.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetPageMode(PageMode)
Sets PageMode property and change the value of the PageMode key in the Catalog dictionary.
Declaration
public void SetPageMode(PDFDocViewPrefs.PageMode mode)
Parameters
Type | Name | Description |
---|---|---|
PDFDocViewPrefs.PageMode | mode | New PageMode setting. Default value is e_UseNone. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetPref(ViewerPref, bool)
Sets the value of given ViewerPref property.
Declaration
public void SetPref(PDFDocViewPrefs.ViewerPref pref, bool value)
Parameters
Type | Name | Description |
---|---|---|
PDFDocViewPrefs.ViewerPref | pref | the ViewerPref property type to modifiy. |
bool | value | The new value for the property. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetPrintArea(Box)
Sets the page boundary representing the area of a page to be rendered when printing the document.
Declaration
public void SetPrintArea(Page.Box box)
Parameters
Type | Name | Description |
---|---|---|
Page.Box | box | printing region. The default value is page crop-box. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetPrintClip(Box)
Sets the page boundary to which the contents of a page are to be clipped when printing the document.
Declaration
public void SetPrintClip(Page.Box box)
Parameters
Type | Name | Description |
---|---|---|
Page.Box | box | printing clip region. The default value is page crop-box. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetViewArea(Box)
Sets the page boundary representing the area of a page to be displayed when viewing the document on the screen.
Declaration
public void SetViewArea(Page.Box box)
Parameters
Type | Name | Description |
---|---|---|
Page.Box | box | page boundary displayed when viewing the document on the screen. By defualt, PDF viewers will display the crop-box. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetViewClip(Box)
Sets the page boundary to which the contents of a page are to be clipped when viewing the document on the screen.
Declaration
public void SetViewClip(Page.Box box)
Parameters
Type | Name | Description |
---|---|---|
Page.Box | box | screen clip region. The default value is page crop-box. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |