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-2018 by PDFTron Systems 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 
46 class Redactor
47 {
48 public:
49  class Redaction
50  {
51  public:
59  Redaction(int page_num, const Rect& bbox, bool negative, const UString& text);
60  ~Redaction();
61 
65  void Destroy();
66 
67  // @cond PRIVATE_DOC
68 #ifndef SWIGHIDDEN
69  Redaction();
70  Redaction(const Redaction& other);
71  Redaction(TRN_Redaction impl);
72  TRN_Redaction mp_imp;
73 #endif
74  // @endcond
75  };
76 
80  class Appearance
81  {
82  public:
84  {
85  // Defaults
86  RedactionOverlay = true;
87  PositiveOverlayColor.Set(1, 1, 1);
88  NegativeOverlayColor.Set(1, 1, 1);
89  UseOverlayText = true;
90  MinFontSize = 2;
91  MaxFontSize = 24;
92  TextColor.Set(0, 0, 0);
93  HorizTextAlignment = -1; // left justified
94  VertTextAlignment = 1; // top justified
95  Border = true;
97  RedactedContentColor.Set(0.3, 0.3, 0.3); // Gray
98  }
99 
107 
112 
117 
121  bool Border;
122 
129 
134 
139 
144 
152 
160 
169 
176  };
177 
191  static void Redact(PDFDoc& doc, const std::vector<Redaction>& red_arr, const Appearance& app = Appearance(), bool ext_neg_mode = true, bool page_coord_sys = true);
192 };
193 
194  }; // namespace PDF
195 }; // namespace pdftron
196 
197 #include <Impl/Redactor.inl>
198 
199 #endif // PDFTRON_H_CPPPDFRedactor
Redaction(int page_num, const Rect &bbox, bool negative, const UString &text)
void Set(double x=0, double y=0, double z=0, double w=0)
static void Redact(PDFDoc &doc, const std::vector< Redaction > &red_arr, const Appearance &app=Appearance(), bool ext_neg_mode=true, bool page_coord_sys=true)

© 2002-2014 PDFTron Systems Inc.