ViewDestination Class Documentation

class ViewDestination

Namespace:datalogics_interface

Detailed Description

A destination describes a place in the PDF document where the user will be taken in response to clicking a hyperlink. The destination defines where a bookmark or hyperlink points to.

The ViewDestination contains a reference to a page, a place (rectangle) on that page, and information specifying how to adjust the view to fit the window's size and shape.

Uses types

Constructor & Destructor Documentation

ViewDestination

ViewDestination(Document & doc, int page_number, const std::string & fit_type, const Rect & rect, double zoom)

Parameters

doc: Document &

Containing document

page_number: int

Target page number

fit_type: const std::string &

Fit Type must be: "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", or "FitBV".

rect: const Rect &

Target rectangle

zoom: double

Zoom level

General purpose constructor: construct with all elements

~ViewDestination

~ViewDestination()

Field Documentation

null_value

static null_value

Constant used for "null" values in destination rectangles or zoom.

Member Function Documentation

get_dest_rect

Rect get_dest_rect()

Returns:

Rect

The destination rectangle for this view.

Coordinates with a value of NullValue indicate that the corresponding coordinate is not specified in the destination.

get_fit_type

std::string get_fit_type()

Returns:

std::string

The fit type string for this destination.

The fit type determines how the page content is fitted into the window. Valid fit types are: "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", and "FitBV".

get_page_number

int get_page_number()

Returns:

int

The zero-based page number for this destination.

The page number of the destination.

get_zoom

double get_zoom()

Returns:

double

The zoom factor, or NullValue if not set.

A value of NullValue indicates that the zoom factor is not specified.

operator==

bool operator==(const ViewDestination & other)

Parameters

other: const ViewDestination &

The ViewDestination to compare against.

Returns:

bool

true if the two ViewDestination objects refer to the same destination, false otherwise.

Two ViewDestination objects are considered equal if their underlying PDF Cos objects are equal.

set_dest_rect

void set_dest_rect(const Rect & rect)

Parameters

rect: const Rect &

The rectangle defining the visible area of the destination page.

Returns:

void

Set the destination rectangle of the view.

set_fit_type

void set_fit_type(const std::string & fit_type)

Parameters

fit_type: const std::string &

The fit type string. Must be one of: "XYZ", "Fit", "FitH", "FitV", "FitR", "FitB", "FitBH", or "FitBV".

Returns:

void

Set the fit type for the view.

set_page_number

void set_page_number(int page_number)

Parameters

page_number: int

The zero-based page number to set as the destination.

Returns:

void

Set the page number of the destination starting at 0.

set_zoom

void set_zoom(double zoom)

Parameters

zoom: double

The zoom level to apply when navigating to this destination.

Returns:

void

Set the zoom factor for the destination.

to_string

std::string to_string()

Returns:

std::string

A formatted string describing this ViewDestination.

The string includes the page number, fit type, destination rectangle, and zoom factor.