PoDoFo  1.0.0-dev
Public Member Functions | Static Public Member Functions | Friends | List of all members
PoDoFo::PdfDestination Class Referencefinal

A destination in a PDF file. More...

#include <PdfDestination.h>

Inherits PoDoFo::PdfArrayElement.

Public Member Functions

void SetDestination (const PdfPage &page, PdfDestinationFit fit=PdfDestinationFit::Fit)
 Create a new PdfDestination with a page as destination. More...
 
void SetDestination (const PdfPage &page, const Rect &rect)
 Create a destination to a page with its contents magnified to fit into the given rectangle. More...
 
void SetDestination (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. More...
 
void SetDestination (const PdfPage &page, PdfDestinationFit fit, double value)
 Create a new destination to a page. More...
 
PdfPageGetPage ()
 Get the page that this destination points to Requires that this PdfDestination was somehow created by or from a PdfDocument. More...
 
PdfDestinationType GetType () const
 Get the destination fit type. More...
 
double GetZoom () const
 Get the destination zoom Destination must be of type XYZ otherwise exception is thrown. More...
 
Rect GetRect () const
 Get the destination rect Destination must be of type FirR otherwise exception is thrown. More...
 
double GetTop () const
 Get the destination Top position Destination must be of type XYZ, FitH, FitR, FitBH otherwise exception is thrown. More...
 
double GetLeft () const
 Get the destination Left position Destination must be of type XYZ, FitV or FitR otherwise exception is thrown. More...
 
double GetDValue () const
 Get the destination Value Destination must be of type FitH, FitV or FitBH, otherwise exception is thrown. More...
 

Static Public Member Functions

static bool TryCreateFromObject (PdfObject &obj, std::unique_ptr< PdfDestination > &dest)
 

Friends

class PdfDocument
 
class PdfAnnotationLink
 
class PdfOutlineItem
 
class PdfNameTreeBase
 

Detailed Description

A destination in a PDF file.

A destination can either be a page or an action.

See also
PdfOutlineItem
PdfAnnotation
PdfDocument

Member Function Documentation

◆ 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

◆ SetDestination() [1/4]

void PdfDestination::SetDestination ( 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

◆ SetDestination() [2/4]

void PdfDestination::SetDestination ( 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

◆ SetDestination() [3/4]

void PdfDestination::SetDestination ( 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

◆ SetDestination() [4/4]

void PdfDestination::SetDestination ( 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

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