Loading...
Searching...
No Matches
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
13namespace pdftron {
14 namespace PDF {
15
16class Redaction;
17class Appearance;
18
50{
51public:
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
77{
78public:
86 Redaction(int page_num, const Rect& bbox, bool negative, const UString& text);
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
108{
109public:
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;
125 RedactedContentColor.Set(0.3, 0.3, 0.3); // Gray
126 }
127
135
140
145
149 bool Border;
150
157
162
167
172
180
188
195
204
211};
212 }; // namespace PDF
213}; // namespace pdftron
214
215#include <Impl/Redactor.inl>
216
217#endif // PDFTRON_H_CPPPDFRedactor
Redaction(int page_num, const Rect &bbox, bool negative, const UString &text)
static void Redact(PDFDoc &doc, const std::vector< Redaction > &red_arr)
static void Redact(PDFDoc &doc, const std::vector< Redaction > &red_arr, const Appearance &app)
static void Redact(PDFDoc &doc, const std::vector< Redaction > &red_arr, const Appearance &app, bool ext_neg_mode)
pdftron::PDF::Redaction Redaction
Definition Redactor.h:52
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 Appearance
Definition Redactor.h:53