Loading...
Searching...
No Matches
Page.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software Inc. All Rights Reserved.
3// Consult legal.txt regarding legal and license information.
4//---------------------------------------------------------------------------------------
5#ifndef PDFTRON_H_CPPPDFPage
6#define PDFTRON_H_CPPPDFPage
7
8#include <PDF/Rect.h>
9#include <SDF/Obj.h>
10#include <C/PDF/TRN_Page.h>
11#include <Common/Matrix2D.h>
12
13namespace pdftron {
14 namespace PDF {
15
16class Annot; // Forward declaration
17class Field;
18class TaggingOptions;
19
31class Page
32{
33public:
34
46 Page (SDF::Obj page_dict = 0);
47
48 Page (const Page& p);
49 Page& operator= (const Page& p);
50
56 bool IsValid() const;
57
63 int GetIndex() const;
64
107
117 Rect GetBox(Box type) const;
118
127 void SetBox(Box type, const Rect& box) const;
128
137
150 void SetCropBox(const Rect& box);
151
164
177 void SetMediaBox(const Rect& box);
178
186
197
206
215
223
232
237
244 void SetRotation(Rotate angle);
245
252 double GetPageWidth(Box box_type = e_crop);
253
260 double GetPageHeight(Box box_type = e_crop);
261
277 Common::Matrix2D GetDefaultMatrix(bool flip_y = false, Box box_type = e_crop, Rotate angle = e_0) const;
278
287
295
305 Annot GetAnnot(UInt32 index) const;
306
308 {
309 e_action_trigger_page_open = 11, //Triggered when the page is opened and shall be executed after such an action
310 e_action_trigger_page_close = 12 //Triggered when the page is closed, This action applies to the page being closed and shall be executed before any other page is opened
311 };
312
320
329 void AnnotInsert(UInt32 pos, Annot& annot);
330
342 void AnnotInsertWithTagging(UInt32 pos, Annot& annot, SDF::Obj& tag_parent, const TaggingOptions& options);
343
344
349 void AnnotPushBack(Annot& annot);
350
355 void AnnotPushFront(Annot& annot);
356
362 void AnnotRemove(Annot& annot);
363
369 void AnnotRemove(UInt32 index);
370
383 void Scale(double scale);
384
398 void FlattenField(class Field field_to_flatten);
399
403 bool HasTransition() const;
404
412 double GetUserUnitSize() const;
413
423 void SetUserUnitSize(double unit_size);
424
430
435
442
461 SDF::Obj FindInheritedAttribute (const char* attrib) const;
462
463
467 operator bool () { return IsValid();}
468
473
474
475// @cond PRIVATE_DOC
476#ifndef SWIGHIDDEN
477 Page(TRN_Page impl);
478 TRN_Page mp_page;
479#endif
480// @endcond
481};
482
483
484 }; // namespace PDF
485}; // namespace pdftron
486#include <Impl/Page.inl>
487
488#endif // PDFTRON_H_CPPPDFPage
SDF::Obj FindInheritedAttribute(const char *attrib) const
void FlattenField(class Field field_to_flatten)
Rect GetVisibleContentBox() const
bool HasTransition() const
static int RotationToDegree(Rotate r)
void Scale(double scale)
double GetPageWidth(Box box_type=e_crop)
SDF::Obj GetAnnots() const
void AnnotInsertWithTagging(UInt32 pos, Annot &annot, SDF::Obj &tag_parent, const TaggingOptions &options)
void SetCropBox(const Rect &box)
int GetIndex() const
double GetUserUnitSize() const
SDF::Obj GetContents() const
void AnnotPushBack(Annot &annot)
UInt32 GetNumAnnots() const
double GetPageHeight(Box box_type=e_crop)
Rotate GetRotation() const
void SetRotation(Rotate angle)
void SetBox(Box type, const Rect &box) const
bool IsValid() const
static Rotate DegreeToRotation(int r)
void SetUserUnitSize(double unit_size)
Rect GetBox(Box type) const
Common::Matrix2D GetDefaultMatrix(bool flip_y=false, Box box_type=e_crop, Rotate angle=e_0) const
Annot GetAnnot(UInt32 index) const
SDF::Obj GetSDFObj() const
SDF::Obj GetThumb() const
Page(SDF::Obj page_dict=0)
void AnnotInsert(UInt32 pos, Annot &annot)
SDF::Obj GetResourceDict() const
@ e_action_trigger_page_open
Definition Page.h:309
@ e_action_trigger_page_close
Definition Page.h:310
void SetMediaBox(const Rect &box)
Rect GetCropBox() const
Page & operator=(const Page &p)
static Rotate SubtractRotations(Rotate r0, Rotate r1)
Rect GetMediaBox() const
void AnnotRemove(UInt32 index)
SDF::Obj GetTriggerAction(Page::ActionTriggerEvent trigger)
void AnnotPushFront(Annot &annot)
void AnnotRemove(Annot &annot)
Page(const Page &p)
static Rotate AddRotations(Rotate r0, Rotate r1)
TRN_UInt32 UInt32
Definition BasicTypes.h:13