Loading...
Searching...
No Matches
pdftron::PDF::Destination Class Reference

`#include <Destination.h>`

## Public Types
enum | FitType { e_XYZ , e_Fit , e_FitH , e_FitV , e_FitR , e_FitB , e_FitBH , e_FitBV }

## Public Member Functions
| Destination (SDF::Obj dest)
| Destination (const Destination &d)
Destination & | operator= (const Destination &d)
bool | IsValid () const
FitType | GetFitType ()
Page | GetPage ()
void | SetPage (Page page)
SDF::Obj | GetSDFObj () const
SDF::Obj | GetExplicitDestObj ()
| Destination (TRN_Destination impl)
| Destination ()

## Static Public Member Functions
static Destination | CreateXYZ (Page page, double left, double top, double zoom)
static Destination | CreateFit (Page page)
static Destination | CreateFitH (Page page, double top)
static Destination | CreateFitV (Page page, double left)
static Destination | CreateFitR (Page page, double left, double bottom, double right, double top)
static Destination | CreateFitB (Page page)
static Destination | CreateFitBH (Page page, double top)
static Destination | CreateFitBV (Page page, double left)

## Detailed Description

A destination defines a particular view of a document, consisting of the following:

- The page of the document to be displayed
- The location of the document window on that page
- The magnification (zoom) factor to use when displaying the page

Destinations may be associated with Bookmarks, Annotations, and Remote Go-To Actions.

Destination is a utility class used to simplify work with PDF Destinations; Please refer to section 8.2.1 'Destinations' in PDF Reference Manual for details.

Definition at line 30 of file Destination.h.

## Member Enumeration Documentation

## ◆ FitType

enum pdftron::PDF::Destination::FitType

View Destination Fit Types:

XYZ - Destination specified as upper-left corner point and a zoom factor. Fit - Fits the page into the window FitH - Fits the widths of the page into the window FitV - Fits the height of the page into a window. FitR - Fits the rectangle specified by its upper-left and lower-right corner points into the window. FitB - Fits the rectangle containing all visible elements on the page into the window. FitBH - Fits the width of the bounding box into the window. FitBV - Fits the height of the bounding box into the window.

Enumerator
e_XYZ |
e_Fit |
e_FitH |
e_FitV |
e_FitR |
e_FitB |
e_FitBH |
e_FitBV |

Definition at line 46 of file Destination.h.

## Constructor & Destructor Documentation

## ◆ Destination() [1/4]

pdftron::PDF::Destination::Destination | ( | SDF::Obj | dest | ) |

Create a Destination and initialize it using given Cos/SDF object.

Parameters

  dest | - a low-level (SDF/Cos) destination object. The low-level destination can be either a named destination (i.e. a Name or a String) or an explicit destination (i.e. an Array Obj). Please refer to section 8.2.1 'Destinations' in PDF Reference Manual for more details.

Note
  The constructor does not copy any data, but is instead the logical equivalent of a type cast.
  Named destinations (in case 'dest' is a Name or a String) are automatically resolved to the explicit destination. If the name can't be resolved to the explicit destination dest.IsValid() will return false.

## ◆ Destination() [2/4]

pdftron::PDF::Destination::Destination | ( | const Destination & | d | ) |

Copy constructor

## ◆ Destination() [3/4]

pdftron::PDF::Destination::Destination | ( | TRN_Destination | impl | ) |

## ◆ Destination() [4/4]

pdftron::PDF::Destination::Destination | ( |  | ) |

## Member Function Documentation

## ◆ CreateFit()

Destination pdftron::PDF::Destination::CreateFit | ( | Page | page | ) |
| static

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.

Parameters

  page | Page object to display

## ◆ CreateFitB()

Destination pdftron::PDF::Destination::CreateFitB | ( | Page | page | ) |
| static

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.

Parameters

  page | Page object to display

## ◆ CreateFitBH()

Destination pdftron::PDF::Destination::CreateFitBH | ( | Page | page,
|  | double | top )
| static

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.

Parameters

  page | Page object to display
  top | vertical coordinate of the top edge of the window

## ◆ CreateFitBV()

Destination pdftron::PDF::Destination::CreateFitBV | ( | Page | page,
|  | double | left )
| static

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.

Parameters

  page | Page object to display
  left | horizontal coordinate of the left edge of the window

## ◆ CreateFitH()

Destination pdftron::PDF::Destination::CreateFitH | ( | Page | page,
|  | double | top )
| static

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.

Parameters

  page | Page object to display
  top | vertical coordinate of the top edge of the window

## ◆ CreateFitR()

Destination pdftron::PDF::Destination::CreateFitR | ( | Page | page,
|  | double | left,
|  | double | bottom,
|  | double | right,
|  | double | top )
| static

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.

Parameters

  page | Page object to display
  left | horizontal coordinate of the left edge of the window
  bottom | vertical coordinate of the bottom edge of the window
  right | horizontal coordinate of the right edge of the window
  top | vertical coordinate of the top edge of the window

## ◆ CreateFitV()

Destination pdftron::PDF::Destination::CreateFitV | ( | Page | page,
|  | double | left )
| static

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.

Parameters

  page | Page object to display
  left | horizontal coordinate of the left edge of the window

## ◆ CreateXYZ()

Destination pdftron::PDF::Destination::CreateXYZ | ( | Page | page,
|  | double | left,
|  | double | top,
|  | double | zoom )
| static

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. the page within the window in the other dimension.

Parameters

  page | Page object to display
  left | horizontal coordinate of the left edge of the window
  top | vertical coordinate of the top edge of the window
  zoom | amount to zoom the page by

## ◆ GetExplicitDestObj()

SDF::Obj pdftron::PDF::Destination::GetExplicitDestObj | ( |  | ) |

Returns
  the explicit destination SDF/Cos object. This is always an Array as shown in Table 8.2 in PDF Reference Manual.

Exceptions

  An | Exception is thrown if this is not a valid Destination.

## ◆ GetFitType()

FitType pdftron::PDF::Destination::GetFitType | ( |  | ) |

Returns
  destination's FitType.

Exceptions

  An | Exception is thrown if this is not a valid Destination.

## ◆ GetPage()

Page pdftron::PDF::Destination::GetPage | ( |  | ) |

Returns
  the Page that this destination refers to.

Exceptions

  An | Exception is thrown if this is not a valid Destination.

## ◆ GetSDFObj()

SDF::Obj pdftron::PDF::Destination::GetSDFObj | ( |  | ) | const

Returns
  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

## ◆ IsValid()

bool pdftron::PDF::Destination::IsValid | ( |  | ) | const

Returns
  True if this is a valid Destination and can be resolved, false otherwise.

Note
  If this method returns false the underlying SDF/Cos object is null and the Action object should be treated as null as well.

## ◆ operator=()

Destination & pdftron::PDF::Destination::operator= | ( | const Destination & | d | ) |

Assignment operator

## ◆ SetPage()

void pdftron::PDF::Destination::SetPage | ( | Page | page | ) |

Modify the destination so that it refers to the new 'page' as the destination page.

Parameters

  page | The new page associated with this Destination.

Exceptions

  An | Exception is thrown if this is not a valid Destination.

The documentation for this class was generated from the following file:

- PDF/Destination.h