Fix bugs with oformpdf format

This commit is contained in:
Oleg Korshul
2023-11-28 00:43:39 +03:00
parent c002de1ad3
commit 5807ffa45a
3 changed files with 9 additions and 3 deletions

View File

@ -31,4 +31,4 @@
*/
#pragma once
static const char* g_format_oform_pdf_meta_tag = "ONLYOFFICE FORM";
static const char* g_format_oform_pdf_meta_tag = "ONLYOFFICEFORM";

View File

@ -609,6 +609,10 @@ namespace NExtractTools
{
nRes = mht2docx_dir(sFrom, sDocxDir, params, convertParams);
}
else if (AVS_OFFICESTUDIO_FILE_DOCUMENT_OFORM_PDF == nFormatFrom)
{
nRes = pdfoform2docx_dir(sFrom, sDocxDir, params, convertParams);
}
else
nRes = AVS_FILEUTILS_ERROR_CONVERT_PARAMS;
if (SUCCEEDED_X2T(nRes))

View File

@ -126,15 +126,17 @@ namespace NExtractTools
if (NULL == pData)
return AVS_FILEUTILS_ERROR_CONVERT;
_UINT32 nRes = 0;
NSFile::CFileBinary oFile;
if (oFile.CreateFile(sTo))
{
bool bIsOk = oFile.WriteFile(pData, dwDataSize);
oFile.CloseFile();
return bIsOk ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
nRes = bIsOk ? 0 : AVS_FILEUTILS_ERROR_CONVERT;
}
return AVS_FILEUTILS_ERROR_CONVERT;
RELEASEARRAYOBJECTS(pData);
return nRes;
}
_UINT32 docx2pdfoform(const std::wstring& sFrom, const std::wstring& sTo, InputParams& params, ConvertParams& convertParams)
{