All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FDFDoc.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2018 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPFDFFDFDoc
6 #define PDFTRON_H_CPPFDFFDFDoc
7 
8 #include <SDF/SDFDoc.h>
9 #include <FDF/FDFField.h>
10 #include <Common/Iterator.h>
11 #include <C/FDF/TRN_FDFDoc.h>
12 #include <PDF/Field.h>
13 
14 namespace pdftron {
15  namespace FDF {
16 
29 
39 class FDFDoc
40 {
41 public:
42 
48  FDFDoc(TRN_FDFDoc impl = 0, bool owner = true);
49 
57  FDFDoc(SDF::SDFDoc& sdfdoc);
58 
64  FDFDoc (const char* filepath);
65  FDFDoc (const UString& filepath);
66 
80  FDFDoc (Filters::Filter stream);
81 
91  FDFDoc (const char* buf, size_t buf_size);
92 
96  ~FDFDoc ();
97 
101  void Close();
102 
106  bool IsModified () const;
107 
127  void Save(const UString& path);
128 
139  std::vector<unsigned char> Save();
140 
141 #ifndef SWIG
142  void Save(const char* &out_buf, size_t& out_buf_size);
143 #endif
144 
148  SDF::Obj GetTrailer ();
149 
154  SDF::Obj GetRoot();
155 
159  SDF::Obj GetFDF();
160 
168 
175  void SetPDFFileName(const UString& filepath);
176 
182  SDF::Obj GetID();
183 
189  void SetID(SDF::Obj id);
190 
206  FDFFieldIterator GetFieldIterator(const UString& field_name);
207 
208 
216  FDFField GetField(const UString& field_name);
217 
223  FDFField FieldCreate(const UString& field_name, PDF::Field::Type type, SDF::Obj field_value = 0);
224  FDFField FieldCreate(const UString& field_name, PDF::Field::Type type, const UString& field_value);
225 
230 
236  static FDFDoc CreateFromXFDF(const UString& file_name);
237 
242  void SaveAsXFDF( const UString& filepath );
243 
249 
256  void MergeAnnots( const UString& command_file, const UString& permitted_user = "" );
257 
258  FDFDoc(const FDFDoc& other);
259 
261 #ifndef SWIGHIDDEN
262  mutable TRN_FDFDoc mp_doc;
263 #endif
264 private:
266  FDFDoc& operator=(const FDFDoc& other);
267  mutable bool m_owner;
268 };
269 
270 
271 #include <Impl/FDFDoc.inl>
272 
273  }; // namespace FDF
274 }; // namespace pdftron
275 
276 #endif // PDFTRON_H_CPPFDFFDFDoc
void SetID(SDF::Obj id)
static FDFDoc CreateFromXFDF(const UString &file_name)
FDFDoc(TRN_FDFDoc impl=0, bool owner=true)
std::vector< unsigned char > Save()
SDF::SDFDoc & GetSDFDoc()
void SetPDFFileName(const UString &filepath)
UString GetPDFFileName()
Common::Iterator< FDFField > FDFFieldIterator
Definition: FDFDoc.h:28
FDFFieldIterator GetFieldIterator()
void MergeAnnots(const UString &command_file, const UString &permitted_user="")
FDFField FieldCreate(const UString &field_name, PDF::Field::Type type, SDF::Obj field_value=0)
bool IsModified() const
FDFField GetField(const UString &field_name)

© 2002-2014 PDFTron Systems Inc.