我使用Aspose.PDF.Cpp.21.5\example目录中HelloWorld工程,转换大pdf文件到word(74页,10M左右)转换的很慢差不多需要20分钟,有没有办法提升转换速度?
Sample_1_out.pdf (4.7 MB)
Sample_2_out.pdf (4.4 MB)
Sample_3_out.pdf (1.9 MB)
附件Sample_1_out.pdf、Sample_2_out.pdf、Sample_3_out.pdf是转换前的原pdf文件,网站限制了附件大小,我拆分成了三个文件,你可以合并这三个文件,然后验证。
转换代码如下:
void ConvertingSimpleExamples()
{
SharedPtr doc;
std::wstring strDir = GetMyDirectoryW();
std::wstring strFilePath = strDir + L"\\Example1.pdf";
System::String docPath(strFilePath.c_str(), strFilePath.size());
doc = MakeObject<Document>(docPath);
std::wstring strSaveDocFilePath = strDir + L"\\Example1.docx";
System::String docSaveDocPath(strSaveDocFilePath.c_str(), strSaveDocFilePath.size());
auto saveOptions = MakeObject<DocSaveOptions>();
saveOptions->set_Format(DocSaveOptions::DocFormat::DocX);
saveOptions->set_Mode(DocSaveOptions::RecognitionMode::Textbox);
saveOptions->CustomProgressHandler = ProgressHandler2(ConversionProgressCallback2);
doc->Save(docSaveDocPath, saveOptions);
}