Commit c5657cec authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

ASCOfficePdfWriter.dll (1.0.1.199)

bug 29366
выставление дефолтной папки со шрифтами под win32 & win64

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@62638 954022d7-b5bf-4e40-9824-e11837661b57
parent 6d75f2b5
......@@ -132,6 +132,11 @@ HRESULT CPdfWriterLib::SetAdditionalParam (CString ParamName, VARIANT ParamValue
m_wsTempDir = CString( ParamValue.bstrVal );
DocSetTempDir( m_pDocument, (wchar_t*)m_wsTempDir.c_str() );
}
else if ( _T("FontDirectory") == sParamName && VT_BSTR == ParamValue.vt )
{
std::wstring strFontDirectory = std::wstring( ParamValue.bstrVal );
SetFontDir(strFontDirectory);
}
else if ( _T("WhiteBackImage") == sParamName && VT_BOOL == ParamValue.vt )
{
m_bIsWhiteBackImage = (ParamValue.boolVal == VARIANT_TRUE) ? true : false;
......
......@@ -2,12 +2,19 @@
#include "PDFWriter.h"
#include "../PdfWriterLib/PdfWriterLib.h"
#include <Shlobj.h>
HRESULT CPDFWriter::FinalConstruct()
{
m_oPdfWriter = new CPdfWriterLib();
if (m_oPdfWriter == NULL) return S_FALSE;
//set default font directory
std::wstring defWinFontDirectory = GetDefWinFontDirectory();
m_oPdfWriter->SetFontDir(defWinFontDirectory);
return S_OK ;
}
......@@ -20,6 +27,21 @@ HRESULT CPDFWriter::OnlineWordToPdf (BSTR sPathXml, BSTR sDstFile, BSTR sHtmlPla
return m_oPdfWriter->OnlineWordToPdf( std::wstring(sPathXml), std::wstring(sDstFile), nReg);
}
/////////////////////////////
std::wstring CPDFWriter::GetDefWinFontDirectory()
{
std::wstring strPath;
wchar_t wsWinFontDir[1024] ={};
if ( !SHGetSpecialFolderPathW( NULL, wsWinFontDir, CSIDL_FONTS, FALSE ) )
wsWinFontDir[0] = '\0';
strPath = std::wstring(wsWinFontDir);
return strPath;
}
/////////////////////////
//-----------------------------------------------------------------------------------------------------
......
B// PDFWriter.h : Declaration of the CPDFWriter
......
......@@ -2,6 +2,6 @@
//1
//0
//1
//198
#define INTVER 1,0,1,198
#define STRVER "1,0,1,198\0"
//200
#define INTVER 1,0,1,200
#define STRVER "1,0,1,200\0"
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