All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Stamper.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2020 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFStamper
6 #define PDFTRON_H_CPPPDFStamper
7 
8 #include <C/PDF/TRN_Stamper.h>
9 #include <PDF/PDFDoc.h>
10 #include <PDF/Image.h>
11 #include <PDF/Page.h>
12 #include <Common/Common.h>
13 #include <SDF/Obj.h>
14 #include <PDF/PageSet.h>
15 
16 namespace pdftron{
17  namespace PDF{
18 
19 
20 
30 class Stamper
31 {
32 public:
33 
34  enum SizeType
35  {
39  };
40 
42  {
46  };
47 
49  {
53  };
54 
56  {
60  };
61 
82  Stamper(SizeType size_type, double a, double b);
83 
87  ~Stamper();
88 
96  void StampImage(PDFDoc& dest_doc, Image src_img, const PageSet& dest_pages);
97 
105  void StampPage(PDFDoc& dest_doc, Page src_page, const PageSet& dest_pages);
106 
114  void StampText(PDFDoc& dest_doc, const UString& src_txt, const PageSet& dest_pages);
115 
122  void SetFont(Font font);
123 
124 
130  void SetFontColor(const ColorPt& color);
131 
137  void SetOpacity(double opacity);
138 
139 
145  void SetRotation(double rotation);
146 
147 
154  void SetAsBackground(bool background);
155 
165  void SetAsAnnotation(bool annotation);
166 
170  void ShowsOnScreen(bool on_screen);
171 
175  void ShowsOnPrint(bool on_print);
176 
189  void SetPosition(double horizontal_distance, double vertical_distance, bool use_percentage=false);
190 
212  void SetAlignment(HorizontalAlignment horizontal_alignment, VerticalAlignment vertical_alignment);
213 
219  void SetTextAlignment(TextAlignment text_alignment);
220 
241  void SetSize(SizeType size_type, double a, double b);
242 
249  static void DeleteStamps(PDFDoc& doc, const PageSet& page_set);
250 
257  static bool HasStamps(PDFDoc& doc, const PageSet& page_set);
258 
262  void Destroy();
263 
264 
265 // @cond PRIVATE_DOC
266 
267 #ifndef SWIGHIDDEN
268  Stamper(TRN_Stamper impl);
269  TRN_Stamper mp_impl;
270 #endif
271 // @endcond
272 
273 
274 };
275 
276 #include <Impl/Stamper.inl>
277 
278  }
279 }
280 
281 #endif // PDFTRON_H_CPPPDFStamper
void StampPage(PDFDoc &dest_doc, Page src_page, const PageSet &dest_pages)
void ShowsOnPrint(bool on_print)
void SetOpacity(double opacity)
void StampText(PDFDoc &dest_doc, const UString &src_txt, const PageSet &dest_pages)
void SetFontColor(const ColorPt &color)
void SetPosition(double horizontal_distance, double vertical_distance, bool use_percentage=false)
void SetSize(SizeType size_type, double a, double b)
void SetTextAlignment(TextAlignment text_alignment)
void ShowsOnScreen(bool on_screen)
void StampImage(PDFDoc &dest_doc, Image src_img, const PageSet &dest_pages)
void SetAlignment(HorizontalAlignment horizontal_alignment, VerticalAlignment vertical_alignment)
void SetAsAnnotation(bool annotation)
void SetAsBackground(bool background)
static bool HasStamps(PDFDoc &doc, const PageSet &page_set)
static void DeleteStamps(PDFDoc &doc, const PageSet &page_set)
Stamper(SizeType size_type, double a, double b)
void SetFont(Font font)
void SetRotation(double rotation)