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-2020 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 
134  std::vector<unsigned char> Save();
135 
136 #ifndef SWIG
137 
147  void Save(const char* &out_buf, size_t& out_buf_size);
148 #endif
149 
153  SDF::Obj GetTrailer ();
154 
159  SDF::Obj GetRoot();
160 
164  SDF::Obj GetFDF();
165 
173 
180  void SetPDFFileName(const UString& filepath);
181 
187  SDF::Obj GetID();
188 
194  void SetID(SDF::Obj id);
195 
211 
227  FDFFieldIterator GetFieldIterator(const UString& field_name);
228 
229 
237  FDFField GetField(const UString& field_name);
238 
244  FDFField FieldCreate(const UString& field_name, PDF::Field::Type type, SDF::Obj field_value = 0);
245  FDFField FieldCreate(const UString& field_name, PDF::Field::Type type, const UString& field_value);
246 
251 
257  static FDFDoc CreateFromXFDF(const UString& file_name);
258 
263  void SaveAsXFDF( const UString& filepath );
264 
270 
277  void MergeAnnots( const UString& command_file, const UString& permitted_user = "" );
278 
279  FDFDoc(const FDFDoc& other);
280 
281 // @cond PRIVATE_DOC
282 #ifndef SWIGHIDDEN
283  mutable TRN_FDFDoc mp_doc;
284 #endif
285 // @endcond
286 private:
287  FDFDoc& operator=(const FDFDoc& other);
288  mutable bool m_owner;
289 };
290 
291 
292 #include <Impl/FDFDoc.inl>
293 
294  }; // namespace FDF
295 }; // namespace pdftron
296 
297 #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)