- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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-2025 by Apryse Software 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 {
36 e_relative_scale = 1,
37 e_absolute_size = 2,
38 e_font_size = 3
39 };
40
41 enum HorizontalAlignment
42 {
43 e_horizontal_left = -1,
44 e_horizontal_center = 0,
45 e_horizontal_right = 1
46 };
47
48 enum VerticalAlignment
49 {
50 e_vertical_bottom = -1,
51 e_vertical_center = 0,
52 e_vertical_top = 1
53 };
54
55 enum TextAlignment
56 {
57 e_align_left = -1,
58 e_align_center = 0,
59 e_align_right = 1
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
pdftron::PDF::Stamper::e_vertical_center
Definition: Stamper.h:51
pdftron::PDF::Stamper::~Stamper
~Stamper()
pdftron::PDF::Image
Definition: Image.h:22
pdftron::PDF::Stamper::StampPage
void StampPage(PDFDoc &dest_doc, Page src_page, const PageSet &dest_pages)
pdftron::PDF::Stamper::ShowsOnPrint
void ShowsOnPrint(bool on_print)
pdftron::PDF::ColorPt
Definition: ColorSpace.h:20
pdftron::PDF::Stamper::e_absolute_size
Definition: Stamper.h:37
pdftron::PDF::Stamper::e_vertical_top
Definition: Stamper.h:52
pdftron::PDF::Stamper::SetOpacity
void SetOpacity(double opacity)
pdftron::PDF::Stamper::HorizontalAlignment
HorizontalAlignment
Definition: Stamper.h:41
pdftron::PDF::Stamper::e_relative_scale
Definition: Stamper.h:36
pdftron::PDF::Stamper::VerticalAlignment
VerticalAlignment
Definition: Stamper.h:48
pdftron::PDF::Stamper::StampText
void StampText(PDFDoc &dest_doc, const UString &src_txt, const PageSet &dest_pages)
pdftron::PDF::PageSet
Definition: PageSet.h:20
PageSet.h
pdftron::PDF::Stamper::SetFontColor
void SetFontColor(const ColorPt &color)
pdftron::PDF::PDFDoc
Definition: PDFDoc.h:71
pdftron::PDF::Stamper::SetPosition
void SetPosition(double horizontal_distance, double vertical_distance, bool use_percentage=false)
pdftron::PDF::Stamper::e_horizontal_left
Definition: Stamper.h:43
pdftron::PDF::Stamper::SizeType
SizeType
Definition: Stamper.h:34
Obj.h
pdftron::PDF::Font
Definition: Font.h:55
PDFDoc.h
Image.h
pdftron::PDF::Stamper::e_vertical_bottom
Definition: Stamper.h:50
pdftron::PDF::Stamper::SetSize
void SetSize(SizeType size_type, double a, double b)
Common.h
pdftron::PDF::Stamper::SetTextAlignment
void SetTextAlignment(TextAlignment text_alignment)
pdftron::PDF::Page
Definition: Page.h:31
pdftron::PDF::Stamper::e_align_center
Definition: Stamper.h:58
pdftron::PDF::Stamper::Destroy
void Destroy()
pdftron::PDF::Stamper::TextAlignment
TextAlignment
Definition: Stamper.h:55
pdftron::PDF::Stamper::e_align_right
Definition: Stamper.h:59
pdftron::PDF::Stamper::ShowsOnScreen
void ShowsOnScreen(bool on_screen)
pdftron::PDF::Stamper::e_horizontal_center
Definition: Stamper.h:44
Page.h
pdftron::PDF::Stamper::StampImage
void StampImage(PDFDoc &dest_doc, Image src_img, const PageSet &dest_pages)
pdftron::PDF::Stamper::SetAlignment
void SetAlignment(HorizontalAlignment horizontal_alignment, VerticalAlignment vertical_alignment)
pdftron::PDF::Stamper::SetAsAnnotation
void SetAsAnnotation(bool annotation)
pdftron::PDF::Stamper::e_horizontal_right
Definition: Stamper.h:45
pdftron::PDF::Stamper
Definition: Stamper.h:30
pdftron::PDF::Stamper::SetAsBackground
void SetAsBackground(bool background)
pdftron::PDF::Stamper::HasStamps
static bool HasStamps(PDFDoc &doc, const PageSet &page_set)
pdftron::PDF::Stamper::e_align_left
Definition: Stamper.h:57
pdftron::PDF::Stamper::DeleteStamps
static void DeleteStamps(PDFDoc &doc, const PageSet &page_set)
pdftron::UString
Definition: UString.h:27
pdftron::PDF::Stamper::Stamper
Stamper(SizeType size_type, double a, double b)
pdftron::PDF::Stamper::e_font_size
Definition: Stamper.h:38
pdftron::PDF::Stamper::SetFont
void SetFont(Font font)
pdftron::PDF::Stamper::SetRotation
void SetRotation(double rotation)