PoDoFo  1.0.0-dev
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 
14 namespace PoDoFo {
15 
16 class PdfPage;
17 
18 enum class PdfDestinationFit
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 
51 class PODOFO_API PdfDestination final : public PdfArrayElement
52 {
53  friend class PdfDocument;
54  friend class PdfAnnotationLink;
55  friend class PdfOutlineItem;
56  friend class PdfNameTreeBase;
57 
58 private:
63 
67 
68  PdfDestination(const PdfDestination&) = default;
69 
70 public:
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 
156 private:
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:108
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:127
A rectangle defined by position and size.
Definition: Rect.h:20
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