PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
PdfDestination.h
1
6#ifndef PDF_DESTINATION_H
7#define PDF_DESTINATION_H
8
9#include "PdfDeclarations.h"
10
11#include <podofo/auxiliary/Rect.h>
12#include "PdfElement.h"
13
14namespace PoDoFo {
15
16class PdfPage;
17
18enum class PdfDestinationFit : uint8_t
19{
20 Unknown = 0,
21 Fit,
22 FitH,
23 FitV,
24 FitB,
25 FitBH,
26 FitBV,
27};
28
34{
35 Unknown = 0,
36 XYZ,
37 Fit,
38 FitH,
39 FitV,
40 FitR,
41 FitB,
42 FitBH,
43 FitBV,
44};
45
51class PODOFO_API PdfDestination final : public PdfArrayElement
52{
53 friend class PdfDocument;
54 friend class PdfAnnotationLink;
55 friend class PdfOutlineItem;
56 friend class PdfNameTreeBase;
57
58private:
63
67
68 PdfDestination(const PdfDestination&) = default;
69
70public:
71 static bool TryCreateFromObject(PdfObject& obj, std::unique_ptr<PdfDestination>& dest);
72
77 void SetDestination(const PdfPage& page, PdfDestinationFit fit = PdfDestinationFit::Fit);
78
83 void SetDestination(const PdfPage& page, const Rect& rect);
84
92 void SetDestination(const PdfPage& page, double left, double top, double zoom);
93
100 void SetDestination(const PdfPage& page, PdfDestinationFit fit, double value);
101
108 PdfPage* GetPage();
109
114 PdfDestinationType GetType() const;
115
122 double GetZoom() const;
123
130 Rect GetRect() const;
131
138 double GetTop() const;
139
146 double GetLeft() const;
147
154 double GetDValue() const;
155
156private:
164 void AddToDictionary(PdfDictionary& dictionary) const;
165};
166
167};
168
169#endif // PDF_DESTINATION_H
170
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
A destination in a PDF file.
Definition PdfDestination.h:52
The PDF dictionary data type of PoDoFo (inherits from PdfDataContainer, the base class for such repre...
Definition PdfDictionary.h:82
PdfDocument is the core interface for working with PDF documents.
Definition PdfDocument.h:111
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:35
A PDF outline item has an title and a destination.
Definition PdfOutlines.h:39
PdfPage is one page in the pdf document.
Definition PdfPage.h:129
An normalized rectangle defined by position (left-bottom) and size.
Definition Rect.h:20
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:38
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16
PdfDestinationType
Destination type, as per 12.3.2.2 of the Pdf spec.
Definition PdfDestination.h:34