PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfDestination.h
1// SPDX-FileCopyrightText: 2006 Dominik Seichter <domseichter@web.de>
2// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
3
4#ifndef PDF_DESTINATION_H
5#define PDF_DESTINATION_H
6
7#include "PdfDeclarations.h"
8
9#include <podofo/auxiliary/Rect.h>
10#include "PdfElement.h"
11
12namespace PoDoFo {
13
14class PdfPage;
15
16enum class PdfDestinationFit : uint8_t
17{
18 Unknown = 0,
19 Fit,
20 FitH,
21 FitV,
22 FitB,
23 FitBH,
24 FitBV,
25};
26
31{
32 Unknown = 0,
33 XYZ,
34 Fit,
35 FitH,
36 FitV,
37 FitR,
38 FitB,
39 FitBH,
40 FitBV,
41};
42
47class PODOFO_API PdfDestination final : public PdfArrayElement
48{
49 friend class PdfDocument;
50 friend class PdfAnnotationLink;
51 friend class PdfOutlineItem;
52 friend class PdfNameTreeBase;
53
54private:
58
61
62 PdfDestination(const PdfDestination&) = default;
63
64public:
65 static bool TryCreateFromObject(PdfObject& obj, std::unique_ptr<PdfDestination>& dest);
66
70 void SetDestination(const PdfPage& page, PdfDestinationFit fit = PdfDestinationFit::Fit);
71
75 void SetDestination(const PdfPage& page, const Rect& rect);
76
83 void SetDestination(const PdfPage& page, double left, double top, double zoom);
84
90 void SetDestination(const PdfPage& page, PdfDestinationFit fit, double value);
91
97 PdfPage* GetPage();
98
102 PdfDestinationType GetType() const;
103
109 double GetZoom() const;
110
116 Rect GetRect() const;
117
123 double GetTop() const;
124
130 double GetLeft() const;
131
137 double GetDValue() const;
138
139private:
146 void AddToDictionary(PdfDictionary& dictionary) const;
147};
148
149};
150
151#endif // PDF_DESTINATION_H
152
This file should be included as the FIRST file in every header of PoDoFo lib.
A destination in a PDF file.
Definition PdfDestination.h:48
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:77
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:108
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A PDF outline item has a title and a destination.
Definition PdfOutlines.h:33
PdfPage is one page in the pdf document.
Definition PdfPage.h:133
An normalized rectangle defined by position (left-bottom) and size.
Definition Rect.h:17
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfDestinationType
Destination type, as per 12.3.2.2 of the Pdf spec.
Definition PdfDestination.h:31