aspose-pdf / Aspose.PDF-for-C

Aspose.PDF for C++ examples project
https://products.aspose.com/pdf/cpp
MIT License
24 stars 10 forks source link

convert pdf to xls exception,how to fix it??? #3

Open barluc opened 4 years ago

barluc commented 4 years ago

111

barluc commented 4 years ago

bool CPdfManager::ConvertToXls(const TCHAR szPdfPath, const TCHAR szSavePath) { log_info_t(_T("ConvertToDocx:%s..."), szPdfPath);

System::String srcPath = ToSystemString(szPdfPath);
System::String dstPath = ToSystemString(szSavePath);

try
{
    auto doc = MakeObject<Document>(srcPath);
    SharedPtr<ExcelSaveOptions> options = MakeObject<ExcelSaveOptions>();
    options->set_Format(ExcelSaveOptions::ExcelFormat::XLSX);
    doc->Save(dstPath, options);
    doc->FreeMemory();
}
catch (std::exception& e)
{
    //There are always exceptions: System::ArgumentOutOfRangeException,why???
    //doc,docx is OK!
    log_info("%s FAIL! %s\n",__FUNCTION__,e.what());
    return false;
}

log_info_t(_T("ConvertToXls SUCCESS!\n"));
return true;

}

kashifiqb commented 4 years ago

@barluc ,

We are sorry for the delayed response. Were you able to get a resolution for this? If not, please post your query in Aspose.PDF forum along with your sample input files to get technical assistance from our team.