- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Redactor.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_CPPPDFRedactor
6 #define PDFTRON_H_CPPPDFRedactor
7
8 #include <vector>
9 #include <PDF/PDFDoc.h>
10 #include <PDF/Element.h>
11 #include <C/PDF/TRN_Redactor.h>
12
13 namespace pdftron {
14 namespace PDF {
15
16 class Redaction;
17 class Appearance;
18
49 class Redactor
50 {
51 public:
52 typedef pdftron::PDF::Redaction Redaction;
53 typedef pdftron::PDF::Appearance Appearance;
67 static void Redact(PDFDoc& doc, const std::vector<Redaction>& red_arr, const Appearance& app, bool ext_neg_mode, bool page_coord_sys);
68 static void Redact(PDFDoc& doc, const std::vector<Redaction>& red_arr, const Appearance& app, bool ext_neg_mode);
69 static void Redact(PDFDoc& doc, const std::vector<Redaction>& red_arr, const Appearance& app);
70 static void Redact(PDFDoc& doc, const std::vector<Redaction>& red_arr);
71
72 };
73
74
75
76 class Redaction
77 {
78 public:
86 Redaction(int page_num, const Rect& bbox, bool negative, const UString& text);
87 ~Redaction();
88
92 void Destroy();
93
94 // @cond PRIVATE_DOC
95 #ifndef SWIGHIDDEN
96 Redaction();
97 Redaction(const Redaction& other);
98 Redaction(TRN_Redaction impl);
99 TRN_Redaction mp_imp;
100 #endif
101 // @endcond
102 };
103
107 class Appearance
108 {
109 public:
110 Appearance()
111 {
112 // Defaults
113 RedactionOverlay = true;
114 PositiveOverlayColor.Set(1, 1, 1);
115 NegativeOverlayColor.Set(1, 1, 1);
116 UseOverlayText = true;
117 MinFontSize = 2;
118 MaxFontSize = 24;
119 TextColor.Set(0, 0, 0);
120 HorizTextAlignment = -1; // left justified
121 VertTextAlignment = 1; // top justified
122 EnableTextWrapping = false;
123 Border = true;
124 ShowRedactedContentRegions = false;
125 RedactedContentColor.Set(0.3, 0.3, 0.3); // Gray
126 }
127
134 bool RedactionOverlay;
135
139 ColorPt PositiveOverlayColor;
140
144 ColorPt NegativeOverlayColor;
145
149 bool Border;
150
156 bool UseOverlayText;
157
161 Font TextFont;
162
166 double MinFontSize, MaxFontSize;
167
171 ColorPt TextColor;
172
179 int HorizTextAlignment;
180
187 int VertTextAlignment;
188
194 bool EnableTextWrapping;
195
203 bool ShowRedactedContentRegions;
204
210 ColorPt RedactedContentColor;
211 };
212 }; // namespace PDF
213 }; // namespace pdftron
214
215 #include <Impl/Redactor.inl>
216
217 #endif // PDFTRON_H_CPPPDFRedactor
pdftron::PDF::Redaction::~Redaction
~Redaction()
pdftron::PDF::ColorPt::Set
void Set(double x=0, double y=0, double z=0, double w=0)
pdftron::PDF::Appearance::UseOverlayText
bool UseOverlayText
Definition: Redactor.h:156
pdftron::PDF::Redaction::Destroy
void Destroy()
pdftron::PDF::Redactor::Redaction
pdftron::PDF::Redaction Redaction
Definition: Redactor.h:52
pdftron::PDF::ColorPt
Definition: ColorSpace.h:20
pdftron::PDF::Redaction::Redaction
Redaction(int page_num, const Rect &bbox, bool negative, const UString &text)
pdftron::PDF::Appearance::HorizTextAlignment
int HorizTextAlignment
Definition: Redactor.h:179
pdftron::PDF::Appearance::Border
bool Border
Definition: Redactor.h:149
pdftron::PDF::Appearance::MinFontSize
double MinFontSize
Definition: Redactor.h:166
pdftron::PDF::Rect
Definition: Rect.h:28
pdftron::PDF::Appearance::VertTextAlignment
int VertTextAlignment
Definition: Redactor.h:187
Element.h
pdftron::PDF::Appearance::RedactedContentColor
ColorPt RedactedContentColor
Definition: Redactor.h:210
pdftron::PDF::Redactor::Appearance
pdftron::PDF::Appearance Appearance
Definition: Redactor.h:53
pdftron::PDF::Appearance::PositiveOverlayColor
ColorPt PositiveOverlayColor
Definition: Redactor.h:139
pdftron::PDF::Appearance::MaxFontSize
double MaxFontSize
Definition: Redactor.h:166
pdftron::PDF::PDFDoc
Definition: PDFDoc.h:71
pdftron::PDF::Appearance::ShowRedactedContentRegions
bool ShowRedactedContentRegions
Definition: Redactor.h:203
pdftron::PDF::Font
Definition: Font.h:55
PDFDoc.h
pdftron::PDF::Appearance::Appearance
Appearance()
Definition: Redactor.h:110
pdftron::PDF::Redaction
Definition: Redactor.h:76
pdftron::PDF::Appearance::TextFont
Font TextFont
Definition: Redactor.h:161
pdftron::PDF::Appearance::RedactionOverlay
bool RedactionOverlay
Definition: Redactor.h:134
pdftron::PDF::Appearance::TextColor
ColorPt TextColor
Definition: Redactor.h:171
pdftron::PDF::Redactor
Definition: Redactor.h:49
pdftron::PDF::Appearance::NegativeOverlayColor
ColorPt NegativeOverlayColor
Definition: Redactor.h:144
pdftron::PDF::Appearance::EnableTextWrapping
bool EnableTextWrapping
Definition: Redactor.h:194
pdftron::PDF::Redactor::Redact
static void Redact(PDFDoc &doc, const std::vector< Redaction > &red_arr, const Appearance &app, bool ext_neg_mode, bool page_coord_sys)
pdftron::PDF::Appearance
Definition: Redactor.h:107
pdftron::UString
Definition: UString.h:27