PoDoFo 0.9.20
PoDoFo::PdfDestination Class Referencefinal

#include <PdfDestination.h>

Public Member Functions

 PdfDestination (PdfObject &obj)
 
 PdfDestination (PdfDocument &doc)
 
 PdfDestination (const PdfPage &page, PdfDestinationFit fit=PdfDestinationFit::Fit)
 
 PdfDestination (const PdfPage &page, const Rect &rect)
 
 PdfDestination (const PdfPage &page, double left, double top, double zoom)
 
 PdfDestination (const PdfPage &page, PdfDestinationFit fit, double value)
 
PdfPageGetPage ()
 
PdfDestinationType GetType () const
 
double GetZoom () const
 
Rect GetRect () const
 
double GetTop () const
 
double GetLeft () const
 
double GetDValue () const
 
void AddToDictionary (PdfDictionary &dictionary) const
 

Detailed Description

A destination in a PDF file. A destination can either be a page or an action.

See also
PdfOutlineItem
PdfAnnotation
PdfDocument

Constructor & Destructor Documentation

◆ PdfDestination() [1/6]

PdfDestination::PdfDestination ( PdfObject & obj)

Create a new PdfDestination from an existing PdfObject (such as loaded from a doc)

Parameters
objthe object to construct from

◆ PdfDestination() [2/6]

PdfDestination::PdfDestination ( PdfDocument & doc)

Create an empty destination - points to nowhere

◆ PdfDestination() [3/6]

PdfDestination::PdfDestination ( const PdfPage & page,
PdfDestinationFit fit = PdfDestinationFit::Fit )

Create a new PdfDestination with a page as destination

Parameters
pagea page which is the destination
fitfit mode for the page. Must be PdfDestinationFit::Fit or PdfDestinationFit::FitB

◆ PdfDestination() [4/6]

PdfDestination::PdfDestination ( const PdfPage & page,
const Rect & rect )

Create a destination to a page with its contents magnified to fit into the given rectangle

Parameters
pagea page which is the destination
rectmagnify the page so that the contents of the rectangle are visible

◆ PdfDestination() [5/6]

PdfDestination::PdfDestination ( const PdfPage & page,
double left,
double top,
double zoom )

Create a new destination to a page with specified left and top coordinates and a zoom factor.

Parameters
pagea page which is the destination
leftleft coordinate
toptop coordinate
zoomzoom factor in the viewer

◆ PdfDestination() [6/6]

PdfDestination::PdfDestination ( const PdfPage & page,
PdfDestinationFit fit,
double value )

Create a new destination to a page.

Parameters
pagea page which is the destination
fitfit mode for the Page. Allowed values are PdfDestinationFit::FitH, PdfDestinationFit::FitV, PdfDestinationFit::FitBH, PdfDestinationFit::FitBV
valuevalue which is a required argument for the selected fit mode

Member Function Documentation

◆ AddToDictionary()

void PdfDestination::AddToDictionary ( PdfDictionary & dictionary) const

Adds this destination to an dictionary. This method handles the all the complexities of making sure it's added correctly

If this destination is empty. Nothing will be added.

Parameters
dictionarythe destination will be added to this dictionary

◆ GetDValue()

double PdfDestination::GetDValue ( ) const

Get the destination Value Destination must be of type FitH, FitV or FitBH, otherwise exception is thrown

Returns
the destination Value

◆ GetLeft()

double PdfDestination::GetLeft ( ) const

Get the destination Left position Destination must be of type XYZ, FitV or FitR otherwise exception is thrown.

Returns
the Left position

◆ GetPage()

PdfPage * PdfDestination::GetPage ( )

Get the page that this destination points to Requires that this PdfDestination was somehow created by or from a PdfDocument. Won't work otherwise.

Returns
the referenced PdfPage

◆ GetRect()

Rect PdfDestination::GetRect ( ) const

Get the destination rect Destination must be of type FirR otherwise exception is thrown

Returns
the destination rect

◆ GetTop()

double PdfDestination::GetTop ( ) const

Get the destination Top position Destination must be of type XYZ, FitH, FitR, FitBH otherwise exception is thrown.

Returns
the Top position

◆ GetType()

PdfDestinationType PdfDestination::GetType ( ) const

Get the destination fit type

Returns
the fit type

◆ GetZoom()

double PdfDestination::GetZoom ( ) const

Get the destination zoom Destination must be of type XYZ otherwise exception is thrown.

Returns
the zoom