Class Destination
A utility method used to set the fist page displayed after
the document is opened. This method is equivalent to
PDFDoc::SetOpenAction(goto_action)
If OpenAction is not specified the document should be opened to the top of the first page at the default magnification factor.
Implements
Inherited Members
Namespace: pdftron.PDF
Assembly: PDFNet.dll
Syntax
public class Destination : IDisposable
Examples
Destination dest = Destination::CreateFit(page);
pdfdoc.GetViewPrefs().SetInitialPage(dest);
Constructors
Destination(Obj)
Instantiates Destination
from given SDF::Obj
object
Declaration
public Destination(Obj dest)
Parameters
Type | Name | Description |
---|---|---|
Obj | dest |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Methods
CreateFit(Page)
Create a new 'Fit' Destination.
The new Destination displays the page designated by 'page', with its contents magnified just enough to fit the entire page within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the page within the window in the other dimension.
Declaration
public static Destination CreateFit(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateFitB(Page)
Create a new 'FitB' Destination.
The new Destination displays the page designated by 'page', with its contents magnified just enough to fit its bounding box entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the bounding box within the window in the other dimension.
Declaration
public static Destination CreateFitB(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateFitBH(Page, double)
Create a new 'FitBH' Destination.
The new Destination displays the page designated by 'page', with the vertical coordinate 'top' positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of its bounding box within the window.
Declaration
public static Destination CreateFitBH(Page page, double top)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
double | top | the top |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateFitBV(Page, double)
Create a new 'FitBV' Destination.
The new Destination displays Display the page designated by 'page', with the horizontal coordinate 'left' positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of its bounding box within the window.
Declaration
public static Destination CreateFitBV(Page page, double left)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
double | left | the left |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateFitH(Page, double)
Create a new 'FitH' Destination.
The new Destination displays the page designated by 'page', with the vertical coordinate 'top' positioned at the top edge of the window and the contents of the page magnified just enough to fit the entire width of the page within the window.
Declaration
public static Destination CreateFitH(Page page, double top)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
double | top | the top |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateFitR(Page, double, double, double, double)
Create a new 'FitR' Destination.
The new Destination displays the page designated by 'page', with its contents magnified just enough to fit the rectangle specified by the coordinates 'left', 'bottom', 'right', and 'top' entirely within the window both horizontally and vertically. If the required horizontal and vertical magnification factors are different, use the smaller of the two, centering the rectangle within the window in the other dimension.
Declaration
public static Destination CreateFitR(Page page, double left, double bottom, double right, double top)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
double | left | the left |
double | bottom | the bottom |
double | right | the right |
double | top | the top |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateFitV(Page, double)
Create a new 'FitV' Destination.
The new Destination displays the page designated by 'page', with the horizontal coordinate 'left' positioned at the left edge of the window and the contents of the page magnified just enough to fit the entire height of the page within the window.
Declaration
public static Destination CreateFitV(Page page, double left)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
double | left | the left |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
CreateXYZ(Page, double, double, double)
Create a new 'XYZ' Destination.
The new Destination displays the page designated by 'page', with the coordinates ('left', 'top') positioned at the top-left corner of the window and the contents of the page magnified by the factor 'zoom'. A null value for any of the parameters 'left', 'top', or 'zoom' specifies that the current value of that parameter is to be retained unchanged. A 'zoom' value of 0 has the same meaning as a null value.
Declaration
public static Destination CreateXYZ(Page page, double left, double top, double zoom)
Parameters
Type | Name | Description |
---|---|---|
Page | page | the page |
double | left | the left |
double | top | the top |
double | zoom | the zoom |
Returns
Type | Description |
---|---|
Destination | the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Dispose()
Releases all resources used by the Destination
Declaration
public override sealed void Dispose()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Dispose(bool)
Declaration
[HandleProcessCorruptedStateExceptions]
protected virtual void Dispose(bool A_0)
Parameters
Type | Name | Description |
---|---|---|
bool | A_0 |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
~Destination()
Declaration
protected ~Destination()
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetExplicitDestObj()
Gets the explicit dest obj.
Declaration
public Obj GetExplicitDestObj()
Returns
Type | Description |
---|---|
Obj | the explicit destination SDF/Cos object. This is always an Array as shown in Table 8.2 in PDF Reference Manual. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetFitType()
Gets the fit type.
Declaration
public Destination.FitType GetFitType()
Returns
Type | Description |
---|---|
Destination.FitType | destination's FitType. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetPage()
Gets the page.
Declaration
public Page GetPage()
Returns
Type | Description |
---|---|
Page | the Page that this destination refers to. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
GetSDFObj()
Gets the SDFObj.
Declaration
public Obj GetSDFObj()
Returns
Type | Description |
---|---|
Obj | the object to the underlying SDF/Cos object. The returned SDF/Cos object is an explicit destination (i.e. the Obj is either an array defining the destination, using the syntax shown in Table 8.2 in PDF Reference Manual), or a dictionary with a 'D' entry whose value is such an array. The latter form allows additional attributes to be associated with the destination |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
IsValid()
Checks if is valid.
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
bool | True if this is a valid Destination and can be resolved, false otherwise. |
Remarks
If this method returns false the underlying SDF/Cos object is null and the Action object should be treated as null as well.
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
Set(Destination)
Sets value to given Destination
object
Declaration
public void Set(Destination p)
Parameters
Type | Name | Description |
---|---|---|
Destination | p | given |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
SetPage(Page)
Modify the destination so that it refers to the new 'page' as the destination page.
Declaration
public void SetPage(Page page)
Parameters
Type | Name | Description |
---|---|---|
Page | page | The new page associated with this Destination. |
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |
op_Assign(Destination)
Assignment operator
Declaration
public Destination op_Assign(Destination r)
Parameters
Type | Name | Description |
---|---|---|
Destination | r |
|
Returns
Type | Description |
---|---|
Destination |
|
Exceptions
Type | Condition |
---|---|
PDFNetException | PDFNetException the PDFNet exception |