All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ElementWriter.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_CPPPDFElementWriter
6 #define PDFTRON_H_CPPPDFElementWriter
7 
8 #include <PDF/Page.h>
9 #include <PDF/Element.h>
10 #include <Common/Matrix2D.h>
11 #include <C/PDF/TRN_ElementWriter.h>
12 #include <PDF/ElementReader.h>
13 
14 namespace pdftron {
15  namespace PDF {
16 
17 
23 {
24 public:
25 
26  ElementWriter();
28 
29 
34  enum WriteMode {
38  };
39 
66  void Begin( Page& page, WriteMode placement = e_overlay, bool page_coord_sys = true, bool compress = true, SDF::Obj resources = 0);
67 
85  void Begin(SDF::SDFDoc& doc, bool compress = true);
86 
87 
107  void Begin(SDF::Obj stream_obj_to_update, bool compress = true, SDF::Obj resources = 0);
108 
114  SDF::Obj End();
115 
120  void WriteElement(Element element);
121 
137  void WritePlacedElement(Element element);
138 
144  void Flush();
145 
151  void WriteBuffer(std::vector<unsigned char> data);
152 
153 #ifndef SWIG
154  void WriteBuffer(const char* data, int data_sz);
155 #endif
156 
162  void WriteString(const char* str);
163 
169  void WriteGStateChanges(Element element);
170 
176  void SetDefaultGState(ElementReader& reader);
177 
181  void Destroy();
182 
183 // @cond PRIVATE_DOC
184 #ifndef SWIGHIDDEN
185  TRN_ElementWriter mp_writer;
186  ElementWriter(TRN_ElementWriter impl);
187 #endif
188 private:
189  // ElementWriter should not be copied
190  ElementWriter(const ElementWriter& other);
191  ElementWriter& operator= (const ElementWriter&);
192 // @endcond
193 
194 
195 
196 };
197 
198 
199 #include <Impl/ElementWriter.inl>
200 
201  }; // namespace PDF
202 }; // namespace pdftron
203 
204 #endif // PDFTRON_H_CPPPDFElementWriter
void WritePlacedElement(Element element)
void WriteGStateChanges(Element element)
void SetDefaultGState(ElementReader &reader)
void WriteElement(Element element)
void WriteString(const char *str)
void Begin(Page &page, WriteMode placement=e_overlay, bool page_coord_sys=true, bool compress=true, SDF::Obj resources=0)
void WriteBuffer(std::vector< unsigned char > data)
element appears on top of the existing graphics
Definition: ElementWriter.h:37
element is put in the background layer of the page
Definition: ElementWriter.h:36