ViewDestination Class Documentation

classViewDestination

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, intpage_number, const std::string &fit_type, const Rect &rect, doublezoom)

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()

Member Function Documentation

get_dest_rect

Rectget_dest_rect()

Returns:

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::stringget_fit_type()

Returns:

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

intget_page_number()

Returns:

The zero-based page number for this destination.

The page number of the destination.

get_pdf_array

Returns:

The underlying PDF array object for this destination.

Retrieve the PDFArray representation of this ViewDestination.

get_zoom

doubleget_zoom()

Returns:

The zoom factor, or NullValue if not set.

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

operator==

booloperator==(const ViewDestination &other)

Parameters

other: const ViewDestination &

The ViewDestination to compare against.

Returns:

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

voidset_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

voidset_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

voidset_page_number(intpage_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

voidset_zoom(doublezoom)

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::stringto_string()

Returns:

A formatted string describing this ViewDestination.

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