Loading...
Searching...
No Matches
ElementWriter.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_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
14namespace pdftron {
15 namespace PDF {
16
17
23{
24public:
25
28
29
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
115
120 void WriteElement(Element element);
121
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
170
177
181 void Destroy();
182
183// @cond PRIVATE_DOC
184#ifndef SWIGHIDDEN
185 TRN_ElementWriter mp_writer;
186 ElementWriter(TRN_ElementWriter impl);
187#endif
188private:
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 WriteElement(Element element)
void Begin(SDF::SDFDoc &doc, bool compress=true)
void Begin(Page &page, WriteMode placement=e_overlay, bool page_coord_sys=true, bool compress=true, SDF::Obj resources=0)
void WriteString(const char *str)
void WritePlacedElement(Element element)
void WriteGStateChanges(Element element)
void WriteBuffer(std::vector< unsigned char > data)
void SetDefaultGState(ElementReader &reader)
void WriteBuffer(const char *data, int data_sz)
void Begin(SDF::Obj stream_obj_to_update, bool compress=true, SDF::Obj resources=0)
@ e_overlay
element appears on top of the existing graphics
@ e_replacement
element will replace current page contents
@ e_underlay
element is put in the background layer of the page