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-2024 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:
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 
108 {
109 public:
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  Border = true;
124  RedactedContentColor.Set(0.3, 0.3, 0.3); // Gray
125  }
126 
134 
139 
144 
148  bool Border;
149 
156 
161 
166 
171 
179 
187 
196 
203 };
204  }; // namespace PDF
205 }; // namespace pdftron
206 
207 #include <Impl/Redactor.inl>
208 
209 #endif // PDFTRON_H_CPPPDFRedactor
void Set(double x=0, double y=0, double z=0, double w=0)
pdftron::PDF::Redaction Redaction
Definition: Redactor.h:52
Redaction(int page_num, const Rect &bbox, bool negative, const UString &text)
ColorPt RedactedContentColor
Definition: Redactor.h:202
pdftron::PDF::Appearance Appearance
Definition: Redactor.h:53
ColorPt PositiveOverlayColor
Definition: Redactor.h:138
ColorPt NegativeOverlayColor
Definition: Redactor.h:143
static void Redact(PDFDoc &doc, const std::vector< Redaction > &red_arr, const Appearance &app, bool ext_neg_mode, bool page_coord_sys)