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
14 namespace pdftron {
15 namespace PDF {
16
17
22 class ElementWriter
23{
24 public:
25
26 ElementWriter();
27 ~ElementWriter();
28
29
33 enum WriteMode
34 {
35 e_underlay,
36 e_overlay,
37 e_replacement
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
Element.h
ElementReader.h
Matrix2D.h
Page.h
pdftron::PDF::Element
Definition Element.h:33
pdftron::PDF::ElementReader
Definition ElementReader.h:61
pdftron::PDF::ElementWriter::WriteElement
void WriteElement(Element element)
pdftron::PDF::ElementWriter::Begin
void Begin(SDF::SDFDoc &doc, bool compress=true)
pdftron::PDF::ElementWriter::Begin
void Begin(Page &page, WriteMode placement=e_overlay, bool page_coord_sys=true, bool compress=true, SDF::Obj resources=0)
pdftron::PDF::ElementWriter::WriteString
void WriteString(const char *str)
pdftron::PDF::ElementWriter::WritePlacedElement
void WritePlacedElement(Element element)
pdftron::PDF::ElementWriter::~ElementWriter
~ElementWriter()
pdftron::PDF::ElementWriter::Flush
void Flush()
pdftron::PDF::ElementWriter::WriteGStateChanges
void WriteGStateChanges(Element element)
pdftron::PDF::ElementWriter::Destroy
void Destroy()
pdftron::PDF::ElementWriter::ElementWriter
ElementWriter()
pdftron::PDF::ElementWriter::End
SDF::Obj End()
pdftron::PDF::ElementWriter::WriteBuffer
void WriteBuffer(std::vector< unsigned char > data)
pdftron::PDF::ElementWriter::SetDefaultGState
void SetDefaultGState(ElementReader &reader)
pdftron::PDF::ElementWriter::WriteBuffer
void WriteBuffer(const char *data, int data_sz)
pdftron::PDF::ElementWriter::Begin
void Begin(SDF::Obj stream_obj_to_update, bool compress=true, SDF::Obj resources=0)
pdftron::PDF::ElementWriter::WriteMode
WriteMode
Definition ElementWriter.h:34
pdftron::PDF::ElementWriter::e_overlay
@ e_overlay
element appears on top of the existing graphics
Definition ElementWriter.h:36
pdftron::PDF::ElementWriter::e_replacement
@ e_replacement
element will replace current page contents
Definition ElementWriter.h:37
pdftron::PDF::ElementWriter::e_underlay
@ e_underlay
element is put in the background layer of the page
Definition ElementWriter.h:35
pdftron::PDF::Page
Definition Page.h:32
pdftron::SDF::Obj
Definition Obj.h:41
pdftron::SDF::SDFDoc
Definition SDFDoc.h:68
pdftron::PDF
Definition Action.h:15
pdftron
Definition BasicTypes.h:10