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-2023 by Apryse Software 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 #include <FDF/XFDFExportOptions.h>
14 
15 namespace pdftron {
16  namespace FDF {
17 
30 
45 class FDFDoc
46 {
47 public:
48 
54  FDFDoc(TRN_FDFDoc impl = 0, bool owner = true);
55 
63  FDFDoc(SDF::SDFDoc& sdfdoc);
64 
70  FDFDoc (const char* filepath);
71  FDFDoc (const UString& filepath);
72 
86  FDFDoc (Filters::Filter stream);
87 
97  FDFDoc (const char* buf, size_t buf_size);
98 
102  ~FDFDoc ();
103 
107  void Close();
108 
112  bool IsModified () const;
113 
134  void Save(const UString& path);
135 
142  std::vector<unsigned char> Save();
143 
144 #ifndef SWIG
145 
156  void Save(const char* &out_buf, size_t& out_buf_size);
157 #endif
158 
163  SDF::Obj GetTrailer ();
164 
170  SDF::Obj GetRoot();
171 
175  SDF::Obj GetFDF();
176 
184 
191  void SetPDFFileName(const UString& filepath);
192 
198  SDF::Obj GetID();
199 
205  void SetID(SDF::Obj id);
206 
222 
238  FDFFieldIterator GetFieldIterator(const UString& field_name);
239 
240 
248  FDFField GetField(const UString& field_name);
249 
255  FDFField FieldCreate(const UString& field_name, PDF::Field::Type type, SDF::Obj field_value = 0);
256  FDFField FieldCreate(const UString& field_name, PDF::Field::Type type, const UString& field_value);
257 
263 
269  static FDFDoc CreateFromXFDF(const UString& file_name);
270 
275  void SaveAsXFDF(const UString& filepath);
276 
282  void SaveAsXFDF(const UString& filepath, const FDF::XFDFExportOptions& opts);
283 
289 
296 
303  void MergeAnnots( const UString& command_file, const UString& permitted_user = "" );
304 
305  FDFDoc(const FDFDoc& other);
306 
307 // @cond PRIVATE_DOC
308 #ifndef SWIGHIDDEN
309  mutable TRN_FDFDoc mp_doc;
310 #endif
311 // @endcond
312 private:
313  FDFDoc& operator=(const FDFDoc& other);
314  mutable bool m_owner;
315 };
316 
317 
318 #include <Impl/FDFDoc.inl>
319 
320  }; // namespace FDF
321 }; // namespace pdftron
322 
323 #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:29
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)