Foxit PDF SDK

fs_splitpdfdoc.h
Go to the documentation of this file.
1
15 #ifndef FS_SPLITPDFDOC_H_
16 #define FS_SPLITPDFDOC_H_
17
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20
21 namespace foxit {
22 namespace pdf {
24 class SplitOutputSettingData FS_FINAL : public Object{
25 public:
27 SplitOutputSettingData()
28 : output_folder_path(L""),
29 add_before_or_after_orginal_name(false),
30 custom_name(L""),
31 separator(L""),
32 is_overwrite(false) {}
33
58 SplitOutputSettingData(const wchar_t* output_folder_path, bool add_before_or_after_orginal_name,
59 const wchar_t* custom_name, const wchar_t* separator, bool is_overwrite) {
60 this->output_folder_path = output_folder_path;
61 this->add_before_or_after_orginal_name = add_before_or_after_orginal_name;
62 this->custom_name = custom_name;
63 this->separator = separator;
64 this->is_overwrite = is_overwrite;
65 }
66
74 SplitOutputSettingData &operator = (const SplitOutputSettingData& data) {
75 this->output_folder_path = data.output_folder_path;
76 this->add_before_or_after_orginal_name = data.add_before_or_after_orginal_name;
77 this->custom_name = data.custom_name;
78 this->separator = data.separator;
79 this->is_overwrite = data.is_overwrite;
80 return (*this);
81 }
82
109 void Set(const wchar_t* output_folder_path, bool add_before_or_after_orginal_name,
110 const wchar_t* custom_name, const wchar_t* separator, bool is_overwrite) {
111 this->output_folder_path = output_folder_path;
112 this->add_before_or_after_orginal_name = add_before_or_after_orginal_name;
113 this->custom_name = custom_name;
114 this->separator = separator;
115 this->is_overwrite = is_overwrite;
116 }
117
128 WString output_folder_path;
129
140 bool add_before_or_after_orginal_name;
141
152 WString custom_name;
153
164 WString separator;
165
173 bool is_overwrite;
174 };
175
177 class SplitDocumentInfo FS_FINAL : public Base{
178 public:
188 SplitDocumentInfo(const wchar_t* file_path, const wchar_t* password);
189
202 SplitDocumentInfo(common::file::ReaderCallback* file_reader, const wchar_t* password, const wchar_t* file_name);
203
217 SplitDocumentInfo(const PDFDoc& doc, const wchar_t* file_name);
218
219 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
220 explicit SplitDocumentInfo(FS_HANDLE handle);
221
223 ~SplitDocumentInfo();
224
230 SplitDocumentInfo(const SplitDocumentInfo& other);
231
239 SplitDocumentInfo& operator=(const SplitDocumentInfo& other);
240
248 bool operator==(const SplitDocumentInfo& other) const;
249
257 bool operator!=(const SplitDocumentInfo& other) const;
258
266 bool IsEmpty() const;
267 };
268
270 FSDK_DEFINE_ARRAY(SplitDocumentInfoArray, SplitDocumentInfo)
271
272
273 class SplitFileResult FS_FINAL : public Object{
274 public:
280 typedef enum _SplitFileState {
282 e_SplitFileSuccess = 0,
289 e_SplitFileErrSizeTooSmall = 1,
296 e_SplitFileErrFileExist = 2,
303 e_SplitFileErrAccessDeny = 3
304 } SplitFileState;
305
306
308 SplitFileResult(){}
309
319 SplitFileResult(const wchar_t* before_splitting_file_name, WStringArray after_split_files_paths, SplitFileState split_file_state) {
320 this->before_splitting_file_name = before_splitting_file_name;
321 this->after_split_files_paths = after_split_files_paths;
322 this->split_file_state = split_file_state;
323 }
324
332 SplitFileResult &operator = (const SplitFileResult& data) {
333 this->before_splitting_file_name = data.before_splitting_file_name;
334 this->after_split_files_paths = data.after_split_files_paths;
335 this->split_file_state = data.split_file_state;
336 return (*this);
337 }
338
343 WString before_splitting_file_name;
344
349 WStringArray after_split_files_paths;
350
355 SplitFileState split_file_state;
356 };
357
359 FSDK_DEFINE_ARRAY(SplitFileResultArray, SplitFileResult)
360
361
365 class SplitPDFDocCallback {
366 public:
372 virtual bool NeedToPause() = 0;
373
384 virtual void ProgressNotify(const wchar_t* before_splitting_file_name, const wchar_t* after_split_file_path, int split_page_count, int total_page_count) = 0;
385
394 virtual void ResultNotify(const SplitFileResultArray& result_array) = 0;
395 };
396
401 class SplitPDFDoc FS_FINAL : public Base{
402 public:
427 static common::Progressive StartSplitByFileSize(float max_file_size, const SplitOutputSettingData& setting_data, const SplitDocumentInfoArray& split_doc_array, SplitPDFDocCallback* split_callback = NULL);
428
429 };
430 } // namespace pdf
431 } // namespace foxit
432
433 #endif
foxit::pdf::SplitDocumentInfo::operator=
SplitDocumentInfo & operator=(const SplitDocumentInfo &other)
Assign operator.
foxit::pdf::SplitOutputSettingData::SplitOutputSettingData
SplitOutputSettingData(const wchar_t *output_folder_path, bool add_before_or_after_orginal_name, const wchar_t *custom_name, const wchar_t *separator, bool is_overwrite)
Constructor, with parameters.
Definition: fs_splitpdfdoc.h:58
foxit::pdf::SplitOutputSettingData::custom_name
WString custom_name
A string value used to be added before or after the original PDF file name to generate a new file nam...
Definition: fs_splitpdfdoc.h:152
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
foxit::pdf::SplitDocumentInfo
Definition: fs_splitpdfdoc.h:177
foxit::pdf::SplitDocumentInfo::SplitDocumentInfo
SplitDocumentInfo(const wchar_t *file_path, const wchar_t *password)
Constructor, with parameters.
foxit::pdf::SplitDocumentInfo::operator==
bool operator==(const SplitDocumentInfo &other) const
Equal operator.
foxit::pdf::SplitOutputSettingData::separator
WString separator
A string value used to inserted between the original PDF file name and the custom name to generate a ...
Definition: fs_splitpdfdoc.h:164
foxit::pdf::SplitOutputSettingData::output_folder_path
WString output_folder_path
A valid folder path for the PDF documents generated by splitting.
Definition: fs_splitpdfdoc.h:128
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:220
foxit::common::Progressive
Definition: fs_common.h:373
foxit::pdf::SplitOutputSettingData::add_before_or_after_orginal_name
bool add_before_or_after_orginal_name
A boolean value is used to determine whether to add the custom name and number before or after the or...
Definition: fs_splitpdfdoc.h:140
fs_common.h
Header file for common definitions and classes.
foxit::pdf::SplitOutputSettingData
Definition: fs_splitpdfdoc.h:24
foxit::pdf::SplitDocumentInfo::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
IFX_FileRead
File reading interface.
Definition: fx_stream.h:587
foxit::pdf::SplitOutputSettingData::Set
void Set(const wchar_t *output_folder_path, bool add_before_or_after_orginal_name, const wchar_t *custom_name, const wchar_t *separator, bool is_overwrite)
Set value.
Definition: fs_splitpdfdoc.h:109
foxit::pdf::SplitPDFDoc
Definition: fs_splitpdfdoc.h:401
foxit::pdf::SplitFileResult::split_file_state
SplitFileState split_file_state
An enumeration value used to represent the status of the PDF documents generated by splitting.
Definition: fs_splitpdfdoc.h:355
foxit::pdf::SplitFileResult::SplitFileResult
SplitFileResult(const wchar_t *before_splitting_file_name, WStringArray after_split_files_paths, SplitFileState split_file_state)
Constructor, with parameters.
Definition: fs_splitpdfdoc.h:319
foxit::pdf::SplitDocumentInfo::operator!=
bool operator!=(const SplitDocumentInfo &other) const
Not equal operator.
foxit::pdf::SplitDocumentInfoArray
Definition: fs_splitpdfdoc.h:270
foxit::pdf::SplitOutputSettingData::SplitOutputSettingData
SplitOutputSettingData()
Constructor.
Definition: fs_splitpdfdoc.h:27
foxit::pdf::SplitFileResult::SplitFileState
SplitFileState
Enumeration for the state of split file.
Definition: fs_splitpdfdoc.h:280
foxit::pdf::SplitFileResult::after_split_files_paths
WStringArray after_split_files_paths
An array of strings used to represent the paths of multiple PDF documents generated by splitting.
Definition: fs_splitpdfdoc.h:349
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::pdf::SplitFileResultArray
Definition: fs_splitpdfdoc.h:359
fs_pdfdoc.h
Header file for PDF document related definitions and classes.
foxit::pdf::SplitOutputSettingData::operator=
SplitOutputSettingData & operator=(const SplitOutputSettingData &data)
Assign operator.
Definition: fs_splitpdfdoc.h:74
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
foxit::pdf::SplitPDFDoc::StartSplitByFileSize
static common::Progressive StartSplitByFileSize(float max_file_size, const SplitOutputSettingData &setting_data, const SplitDocumentInfoArray &split_doc_array, SplitPDFDocCallback *split_callback=0)
Start to split the PDF document into multiple PDF documents.
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:776
foxit::WStringArray
Definition: fs_basictypes.h:227
foxit::pdf::SplitFileResult::before_splitting_file_name
WString before_splitting_file_name
A string value used to represent the original PDF file name before splitting.
Definition: fs_splitpdfdoc.h:343
foxit::pdf::SplitPDFDocCallback
Definition: fs_splitpdfdoc.h:365
foxit::pdf::SplitDocumentInfo::~SplitDocumentInfo
~SplitDocumentInfo()
Destructor.
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::pdf::SplitFileResult
Definition: fs_splitpdfdoc.h:273
foxit::pdf::SplitFileResult::SplitFileResult
SplitFileResult()
Constructor.
Definition: fs_splitpdfdoc.h:308
foxit::Base
Definition: fs_basictypes.h:451
foxit::pdf::SplitOutputSettingData::is_overwrite
bool is_overwrite
A boolean value used to indicate whether to overwrite the PDF document generated by splitting when th...
Definition: fs_splitpdfdoc.h:173