Commit 5818f499 authored by Oleg Korshul's avatar Oleg Korshul

htmlrenderer no base64

parent 691042c5
...@@ -181,7 +181,7 @@ namespace NSHtmlRenderer ...@@ -181,7 +181,7 @@ namespace NSHtmlRenderer
virtual HRESULT put_Mode(LONG lMode); virtual HRESULT put_Mode(LONG lMode);
virtual HRESULT CreateOfficeFile(std::wstring bsFileName, const std::wstring& fontsDir = L""); virtual HRESULT CreateOfficeFile(std::wstring bsFileName, const std::wstring& fontsDir = L"");
virtual HRESULT CloseFile(); virtual HRESULT CloseFile(bool bIsNoBase64 = false);
virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue); virtual HRESULT SetAdditionalParam(std::string sParamName, int nValue);
virtual HRESULT SetAdditionalParam(std::string sParamName, const std::wstring& sParam); virtual HRESULT SetAdditionalParam(std::string sParamName, const std::wstring& sParam);
......
...@@ -1287,14 +1287,14 @@ namespace NSHtmlRenderer ...@@ -1287,14 +1287,14 @@ namespace NSHtmlRenderer
m_pInternal->m_oSimpleGraphicsConverter.SetRenderer(this); m_pInternal->m_oSimpleGraphicsConverter.SetRenderer(this);
return S_OK; return S_OK;
} }
HRESULT CASCHTMLRenderer3::CloseFile() HRESULT CASCHTMLRenderer3::CloseFile(bool bIsNoBase64)
{ {
if (m_pInternal->m_bPageOpened) if (m_pInternal->m_bPageOpened)
{ {
m_pInternal->EndPage(); m_pInternal->EndPage();
} }
m_pInternal->m_oWriter.WriteEndDocument(m_pInternal->m_oDocument); m_pInternal->m_oWriter.WriteEndDocument(m_pInternal->m_oDocument, bIsNoBase64);
return S_OK; return S_OK;
} }
......
...@@ -2075,7 +2075,7 @@ namespace NSHtmlRenderer ...@@ -2075,7 +2075,7 @@ namespace NSHtmlRenderer
m_bIsGids = false; m_bIsGids = false;
} }
void WriteEndDocument(CDocument& oDocument) void WriteEndDocument(CDocument& oDocument, bool bIsNoBase64)
{ {
CMetafile oDocInfo; CMetafile oDocInfo;
oDocInfo.WriteLONG(m_lPagesCount); oDocInfo.WriteLONG(m_lPagesCount);
...@@ -2114,6 +2114,17 @@ namespace NSHtmlRenderer ...@@ -2114,6 +2114,17 @@ namespace NSHtmlRenderer
NSFile::CFileBinary::Remove(m_strDstDirectoryFiles + L"/document_temp.bin"); NSFile::CFileBinary::Remove(m_strDstDirectoryFiles + L"/document_temp.bin");
if (bIsNoBase64)
{
NSFile::CFileBinary oDestinationFile;
oDestinationFile.CreateFileW(m_strDstDirectoryFiles + L"/Editor.bin");
oDestinationFile.WriteFile(pData, (DWORD)lSizeAll);
oDestinationFile.CloseFile();
RELEASEARRAYOBJECTS(pData);
}
else
{
char* pOutput = NULL; char* pOutput = NULL;
int nOutputLen = 0; int nOutputLen = 0;
NSFile::CBase64Converter::Encode(pData, lSizeAll, pOutput, nOutputLen, NSBase64::B64_BASE64_FLAG_NOCRLF); NSFile::CBase64Converter::Encode(pData, lSizeAll, pOutput, nOutputLen, NSBase64::B64_BASE64_FLAG_NOCRLF);
...@@ -2131,6 +2142,9 @@ namespace NSHtmlRenderer ...@@ -2131,6 +2142,9 @@ namespace NSHtmlRenderer
_file.CloseFile(); _file.CloseFile();
RELEASEARRAYOBJECTS(pOutput);
}
::CFontManager* pFontManager = m_pApplicationFonts->GenerateFontManager(); ::CFontManager* pFontManager = m_pApplicationFonts->GenerateFontManager();
m_oDstFontGenerator.WriteFonts(pFontManager, m_strDstDirectoryFiles + L"/fonts", m_bIsGids); m_oDstFontGenerator.WriteFonts(pFontManager, m_strDstDirectoryFiles + L"/fonts", m_bIsGids);
RELEASEOBJECT(pFontManager); RELEASEOBJECT(pFontManager);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment