Foxit PDF SDK

fs_splitpdfdoc.h
浏览该文件的文档.
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
216 SplitDocumentInfo(const PDFDoc& doc, const wchar_t* file_name);
217
218 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
219 explicit SplitDocumentInfo(FS_HANDLE handle);
220
222 ~SplitDocumentInfo();
223
229 SplitDocumentInfo(const SplitDocumentInfo& other);
230
238 SplitDocumentInfo& operator=(const SplitDocumentInfo& other);
239
247 bool operator==(const SplitDocumentInfo& other) const;
248
256 bool operator!=(const SplitDocumentInfo& other) const;
257
265 bool IsEmpty() const;
266 };
267
269 FSDK_DEFINE_ARRAY(SplitDocumentInfoArray, SplitDocumentInfo)
270
271
272 class SplitFileResult FS_FINAL : public Object{
273 public:
279 typedef enum _SplitFileState {
281 e_SplitFileSuccess = 0,
288 e_SplitFileErrSizeTooSmall = 1,
295 e_SplitFileErrFileExist = 2,
302 e_SplitFileErrAccessDeny = 3
303 } SplitFileState;
304
305
307 SplitFileResult(){}
308
318 SplitFileResult(const wchar_t* before_splitting_file_name, WStringArray after_split_files_paths, SplitFileState split_file_state) {
319 this->before_splitting_file_name = before_splitting_file_name;
320 this->after_split_files_paths = after_split_files_paths;
321 this->split_file_state = split_file_state;
322 }
323
331 SplitFileResult &operator = (const SplitFileResult& data) {
332 this->before_splitting_file_name = data.before_splitting_file_name;
333 this->after_split_files_paths = data.after_split_files_paths;
334 this->split_file_state = data.split_file_state;
335 return (*this);
336 }
337
342 WString before_splitting_file_name;
343
348 WStringArray after_split_files_paths;
349
354 SplitFileState split_file_state;
355 };
356
358 FSDK_DEFINE_ARRAY(SplitFileResultArray, SplitFileResult)
359
360
364 class SplitPDFDocCallback {
365 public:
371 virtual bool NeedToPause() = 0;
372
383 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;
384
393 virtual void ResultNotify(const SplitFileResultArray& result_array) = 0;
394 };
395
400 class SplitPDFDoc FS_FINAL : public Base{
401 public:
424 static common::Progressive StartSplitByFileSize(float max_file_size, const SplitOutputSettingData& setting_data, const SplitDocumentInfoArray& split_doc_array, SplitPDFDocCallback* split_callback = NULL);
425
426 };
427 } // namespace pdf
428 } // namespace foxit
429
430 #endif
foxit::pdf::SplitDocumentInfo
Definition: fs_splitpdfdoc.h:177
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)
开始将PDF文档拆分为多个PDF文档。
foxit::pdf::SplitOutputSettingData::operator=
SplitOutputSettingData & operator=(const SplitOutputSettingData &data)
赋值操作符。
Definition: fs_splitpdfdoc.h:74
foxit::Object
CFX_Object Object
对象类型。
Definition: fs_basictypes.h:220
foxit::pdf::SplitFileResult::SplitFileResult
SplitFileResult(const wchar_t *before_splitting_file_name, WStringArray after_split_files_paths, SplitFileState split_file_state)
带参数的构造函数。
Definition: fs_splitpdfdoc.h:318
foxit::pdf::SplitOutputSettingData::separator
WString separator
用于在原始PDF文件名和自定义名称之间插入以生成新文件名的字符串值。默认值：L""。
Definition: fs_splitpdfdoc.h:164
fs_pdfdoc.h
PDF文档相关定义和类的头文件。
foxit::WStringArray
Definition: fs_basictypes.h:227
IFX_FileRead
文件读取接口。
Definition: fx_stream.h:587
foxit::pdf::SplitFileResult::after_split_files_paths
WStringArray after_split_files_paths
用于表示拆分生成的多个PDF文档路径的字符串数组。
Definition: fs_splitpdfdoc.h:348
CFX_WideString
宽字符串类
Definition: fx_string.h:1457
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:768
foxit::pdf::SplitFileResultArray
Definition: fs_splitpdfdoc.h:358
foxit::pdf::SplitPDFDoc
Definition: fs_splitpdfdoc.h:400
foxit::pdf::SplitDocumentInfo::operator==
bool operator==(const SplitDocumentInfo &other) const
相等操作符。
foxit::pdf::SplitPDFDocCallback
Definition: fs_splitpdfdoc.h:364
foxit::pdf::SplitFileResult::SplitFileState
SplitFileState
拆分文件状态的枚举。
Definition: fs_splitpdfdoc.h:279
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)
带参数的构造函数。
Definition: fs_splitpdfdoc.h:58
foxit::pdf::SplitOutputSettingData::SplitOutputSettingData
SplitOutputSettingData()
构造函数。
Definition: fs_splitpdfdoc.h:27
foxit::pdf::SplitFileResult::SplitFileResult
SplitFileResult()
构造函数。
Definition: fs_splitpdfdoc.h:307
foxit::pdf::SplitDocumentInfo::operator=
SplitDocumentInfo & operator=(const SplitDocumentInfo &other)
赋值操作符。
foxit::pdf::SplitFileResult::before_splitting_file_name
WString before_splitting_file_name
用于表示拆分前原始PDF文件名的字符串值。
Definition: fs_splitpdfdoc.h:342
foxit::pdf::SplitOutputSettingData::add_before_or_after_orginal_name
bool add_before_or_after_orginal_name
用于确定是否在原始PDF文件名之前或之后添加自定义名称和数字的布尔值。 默认值：false。
Definition: fs_splitpdfdoc.h:140
foxit::pdf::SplitDocumentInfo::SplitDocumentInfo
SplitDocumentInfo(const wchar_t *file_path, const wchar_t *password)
带参数的构造函数。
foxit::pdf::SplitDocumentInfo::~SplitDocumentInfo
~SplitDocumentInfo()
析构函数。
foxit::common::Progressive
Definition: fs_common.h:373
foxit::FS_HANDLE
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:213
fs_common.h
通用定义和类的头文件。
foxit::pdf::SplitFileResult
Definition: fs_splitpdfdoc.h:272
foxit::Base
Definition: fs_basictypes.h:465
foxit::pdf::SplitDocumentInfo::IsEmpty
bool IsEmpty() const
检查当前对象是否为空。
foxit::pdf::SplitOutputSettingData::output_folder_path
WString output_folder_path
拆分生成的PDF文档的有效文件夹路径。
Definition: fs_splitpdfdoc.h:128
foxit
Foxit命名空间。
Definition: fs_taggedpdf.h:27
foxit::pdf::SplitOutputSettingData::is_overwrite
bool is_overwrite
用于指示当文件已存在时是否覆盖拆分生成的PDF文档的布尔值。默认值：false。
Definition: fs_splitpdfdoc.h:173
foxit::pdf::SplitOutputSettingData::custom_name
WString custom_name
用于在原始PDF文件名之前或之后添加以生成新文件名的字符串值。默认值：L""。
Definition: fs_splitpdfdoc.h:152
foxit::pdf::SplitDocumentInfo::operator!=
bool operator!=(const SplitDocumentInfo &other) const
不相等操作符。
NULL
#define NULL
空指针值。
Definition: fx_system.h:792
foxit::pdf::SplitDocumentInfoArray
Definition: fs_splitpdfdoc.h:269
foxit::pdf::SplitFileResult::split_file_state
SplitFileState split_file_state
用于表示拆分生成的PDF文档状态的枚举值。
Definition: fs_splitpdfdoc.h:354
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)
设置值。
Definition: fs_splitpdfdoc.h:109
foxit::pdf::SplitOutputSettingData
Definition: fs_splitpdfdoc.h:24