Commit c625cdb2 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

печать

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@61389 954022d7-b5bf-4e40-9824-e11837661b57
parent f855d5e1
......@@ -9,6 +9,7 @@
#ifndef PdfWriter_AscEditorPDFPrinter_h
#define PdfWriter_AscEditorPDFPrinter_h
#include <string>
#include <vector>
class CAscEditorPDFPrinter
{
......@@ -16,17 +17,22 @@ public:
std::wstring m_strImagesPath;
std::wstring m_strPresentationThemesPath;
bool m_bUseSystemFonts;
std::wstring m_strFontsDirectory;
bool m_bUseFontsDirectory;
bool m_bUseSystemFonts;
std::vector<std::wstring> m_arFontsDirectory;
public:
CAscEditorPDFPrinter()
{
m_strImagesPath = L"";
m_strPresentationThemesPath = L"";
m_bUseSystemFonts = false;
m_strFontsDirectory = L"";
m_bUseSystemFonts = false;
m_bUseFontsDirectory = false;
}
public:
......
......@@ -15,9 +15,16 @@
bool CAscEditorPDFPrinter::Print(std::string strBase64, std::wstring strDstFile)
{
CPdfWriterLib oWriter;
// TODO: fonts system parameter use
CString sFonts(m_strFontsDirectory.c_str());
oWriter.SetFontDir(sFonts);
if (m_bUseFontsDirectory)
{
CString sFonts(m_strFontsDirectory.c_str());
oWriter.SetFontDir(sFonts);
}
else
{
oWriter.InitializeFonts(m_bUseSystemFonts, m_arFontsDirectory);
}
HRESULT hRes = S_OK;
try
......
......@@ -22,9 +22,17 @@ bool CBgraFrame::SaveFile(const std::wstring& strFileName, unsigned int nFileTyp
NSFile::CFileBinary oFile;
if (!oFile.CreateFileW(strFileName))
return false;
uint32_t lStride = 4 * m_lWidth;
uint32_t lBitsPerPixel = 4;
if (0 != m_lStride)
{
lStride = (m_lStride > 0) ? (uint32_t)m_lStride : (uint32_t)(-m_lStride);
lBitsPerPixel = lStride / m_lWidth;
}
CxImage img;
if (!img.CreateFromArray(m_pData, m_lWidth, m_lHeight, 32, 4 * m_lWidth, (m_lStride >= 0) ? true : false))
if (!img.CreateFromArray(m_pData, m_lWidth, m_lHeight, lBitsPerPixel * 8, lStride, (m_lStride >= 0) ? true : false))
return false;
if (!img.Encode( oFile.GetFileNative(), nFileType ))
......
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