Commit 512ba072 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Реализована специальная функция для записи картинок с маской (сделано...

Реализована специальная функция для записи картинок с маской (сделано специально для Djvu). Реализована запись скрытого текста из Djvu (тоже с объединялкой, как и в обычной ситуации).

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63315 954022d7-b5bf-4e40-9824-e11837661b57
parent 608c5df9
This diff is collapsed.
......@@ -181,12 +181,14 @@ public:
HRESULT SetRadialGradient(const double& dX1, const double& dY1, const double& dR1, const double& dX2, const double& dY2, const double& dR2);
HRESULT OnlineWordToPdf (const std::wstring& wsSrcFile, const std::wstring& wsDstFile);
HRESULT OnlineWordToPdfFromBinary(const std::wstring& wsSrcFile, const std::wstring& wsDstFile);
HRESULT DrawImageWith1bppMask(IGrObject* pImage, Pix* pMaskBuffer, const unsigned int& unMaskWidth, const unsigned int& unMaskHeight, const double& dX, const double& dY, const double& dW, const double& dH);
private:
void OnlineWordToPdfInternal(BYTE* dstArray, LONG lLen, const std::wstring& wsHtmlPlace, std::wstring& wsHypers, int& nCountPages, const std::wstring& wsTempLogo, LONG lReg);
PdfWriter::CImageDict* LoadImage(Aggplus::CImage* pImage, const BYTE& nAlpha);
bool DrawImage(Aggplus::CImage* pImage, const double& dX, const double& dY, const double& dW, const double& dH, const BYTE& nAlpha);
bool DrawText(unsigned int* pUnicodes, unsigned int unLen, const double& dX, const double& dY);
void UpdateFont();
void UpdateTransform();
void UpdatePen();
......
......@@ -37,8 +37,6 @@
#include <vector>
#include <ctime>
#ifdef DrawText
#undef DrawText
#endif
......@@ -920,7 +918,8 @@ void TestMetafile()
}
void TestOnlineBin()
{
std::wstring wsFolderPath = L"D://Test Files//Txt//IvanovaVeronica//";
std::wstring wsFolderPath = L"D://Test Files//Txt//";
//std::wstring wsFolderPath = L"D://Test Files//Txt//IvanovaVeronica//";
std::wstring wsTempFolder = L"D://Test Files//Temp//";
CApplicationFonts oFonts;
......
......@@ -260,6 +260,32 @@ namespace PdfWriter
pParams->Add("JBIG2Globals", pJbig2Global);
Add("DecodeParms", pDecodeParams);
}
void CImageDict::LoadMask(Pix* pPix, unsigned int unWidth, unsigned int unHeight)
{
CImageDict* pMask = new CImageDict(m_pXref, m_pDocument);
if (!pMask)
return;
pMask->SetStream(m_pXref, new CMemoryStream());
CJbig2Global* pJbig2Global = m_pDocument->GetJbig2Global();
pJbig2Global->AddImage(pPix, pMask->GetStream());
pMask->Add("Type", "XObject");
pMask->Add("Subtype", "Image");
pMask->Add("Width", unWidth);
pMask->Add("Height", unHeight);
pMask->Add("BitsPerComponent", 1);
pMask->Add("ImageMask", true);
pMask->SetFilter(STREAM_FILTER_JBIG2_DECODE);
CArrayObject* pDecodeParams = new CArrayObject();
CDictObject* pParams = new CDictObject();
pDecodeParams->Add(pParams);
pParams->Add("JBIG2Globals", pJbig2Global);
pMask->Add("DecodeParms", pDecodeParams);
Add("Mask", pMask);
}
//----------------------------------------------------------------------------------------
// CJbig2Global
//----------------------------------------------------------------------------------------
......
......@@ -38,6 +38,7 @@ namespace PdfWriter
void LoadSMask(const BYTE* pBuffer, unsigned int unSize, unsigned int unWidth, unsigned int unHeight);
void LoadBW(const BYTE* pImage, unsigned int unWidth, unsigned int unHeight, unsigned int unStride);
void LoadBW(Pix* pPix, unsigned int unWidth, unsigned int unHeight);
void LoadMask(Pix* pPix, unsigned int unWidth, unsigned int unHeight);
private:
......
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