ViewDestination Class Documentation
class ViewDestinationNamespace: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.
Referenced by
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: intTarget 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: doubleZoom level
General purpose constructor: construct with all elements
ViewDestination
ViewDestination(ViewDestination && )Parameters
~ViewDestination
~ViewDestination()Field Documentation
null_value
static null_valueConstant used for "null" values in destination rectangles or zoom.
Member Function Documentation
get_dest_rect
Rect get_dest_rect()Returns:
RectThe 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::stringThe 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:
intThe zero-based page number for this destination.
The page number of the destination.
get_pdf_array
std::unique_ptr< PDFArray > get_pdf_array()Returns:
std::unique_ptr< PDFArray >The underlying PDF array object for this destination.
Retrieve the PDFArray representation of this ViewDestination.
get_zoom
double get_zoom()Returns:
doubleThe zoom factor, or NullValue if not set.
A value of NullValue indicates that the zoom factor is not specified.
operator=
ViewDestination & operator=(ViewDestination && )Parameters
Returns:
ViewDestination &operator==
bool operator==(const ViewDestination & other)Parameters
other: const ViewDestination &The ViewDestination to compare against.
Returns:
booltrue 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:
voidSet 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:
voidSet the fit type for the view.
set_page_number
void set_page_number(int page_number)Parameters
page_number: intThe zero-based page number to set as the destination.
Returns:
voidSet the page number of the destination starting at 0.
set_zoom
void set_zoom(double zoom)Parameters
zoom: doubleThe zoom level to apply when navigating to this destination.
Returns:
voidSet the zoom factor for the destination.
to_string
std::string to_string()Returns:
std::stringA formatted string describing this ViewDestination.
The string includes the page number, fit type, destination rectangle, and zoom factor.