Commit 780b22d9 authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@52645 954022d7-b5bf-4e40-9824-e11837661b57
parent 62df9189

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxRenderer", "ASCOfficeDocxRenderer\ASCOfficeDocxRenderer.vcproj", "{B9D1A580-70B2-4CF0-A8D4-152A8E84015E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_filesystem", "..\Common\ASCDocxFormat\Projects\boost_filesystem.vcproj", "{3C7D3E76-9C62-4D0E-9645-8731700B1D70}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_system", "..\Common\ASCDocxFormat\Projects\boost_system.vcproj", "{7A3C0AE1-9FA1-4F56-99C0-139192364F57}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\Common\ASCDocxFormat\Projects\Common.vcproj", "{873D625C-37E4-47C4-8120-2D9FC6A98765}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\ASCDocxFormat\Projects\DocxFormat.vcproj", "{67EB0D73-21A0-44C9-ADB2-109526E60429}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeSvmFile", "..\ASCImageStudio3\ASCGraphics\OfficeSvmFile\OfficeSvmFile.vcproj", "{7D2165DA-B528-4318-A03F-6E922547C09D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Utility", "..\Common\ASCDocxFormat\Projects\Utility.vcproj", "{56F6B346-D0EA-4149-88C4-B6D09E0E9BA6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XML", "..\Common\ASCDocxFormat\Projects\XML.vcproj", "{CF068422-CD0A-484E-B4A9-A0CD108EBBB9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B9D1A580-70B2-4CF0-A8D4-152A8E84015E}.Debug|Win32.ActiveCfg = Debug|Win32
{B9D1A580-70B2-4CF0-A8D4-152A8E84015E}.Debug|Win32.Build.0 = Debug|Win32
{B9D1A580-70B2-4CF0-A8D4-152A8E84015E}.Release|Win32.ActiveCfg = Release|Win32
{B9D1A580-70B2-4CF0-A8D4-152A8E84015E}.Release|Win32.Build.0 = Release|Win32
{3C7D3E76-9C62-4D0E-9645-8731700B1D70}.Debug|Win32.ActiveCfg = Debug|Win32
{3C7D3E76-9C62-4D0E-9645-8731700B1D70}.Debug|Win32.Build.0 = Debug|Win32
{3C7D3E76-9C62-4D0E-9645-8731700B1D70}.Release|Win32.ActiveCfg = Release|Win32
{3C7D3E76-9C62-4D0E-9645-8731700B1D70}.Release|Win32.Build.0 = Release|Win32
{7A3C0AE1-9FA1-4F56-99C0-139192364F57}.Debug|Win32.ActiveCfg = Debug|Win32
{7A3C0AE1-9FA1-4F56-99C0-139192364F57}.Debug|Win32.Build.0 = Debug|Win32
{7A3C0AE1-9FA1-4F56-99C0-139192364F57}.Release|Win32.ActiveCfg = Release|Win32
{7A3C0AE1-9FA1-4F56-99C0-139192364F57}.Release|Win32.Build.0 = Release|Win32
{873D625C-37E4-47C4-8120-2D9FC6A98765}.Debug|Win32.ActiveCfg = Debug|Win32
{873D625C-37E4-47C4-8120-2D9FC6A98765}.Debug|Win32.Build.0 = Debug|Win32
{873D625C-37E4-47C4-8120-2D9FC6A98765}.Release|Win32.ActiveCfg = Release|Win32
{873D625C-37E4-47C4-8120-2D9FC6A98765}.Release|Win32.Build.0 = Release|Win32
{67EB0D73-21A0-44C9-ADB2-109526E60429}.Debug|Win32.ActiveCfg = Debug|Win32
{67EB0D73-21A0-44C9-ADB2-109526E60429}.Debug|Win32.Build.0 = Debug|Win32
{67EB0D73-21A0-44C9-ADB2-109526E60429}.Release|Win32.ActiveCfg = Release|Win32
{67EB0D73-21A0-44C9-ADB2-109526E60429}.Release|Win32.Build.0 = Release|Win32
{7D2165DA-B528-4318-A03F-6E922547C09D}.Debug|Win32.ActiveCfg = Debug|Win32
{7D2165DA-B528-4318-A03F-6E922547C09D}.Debug|Win32.Build.0 = Debug|Win32
{7D2165DA-B528-4318-A03F-6E922547C09D}.Release|Win32.ActiveCfg = Release|Win32
{7D2165DA-B528-4318-A03F-6E922547C09D}.Release|Win32.Build.0 = Release|Win32
{56F6B346-D0EA-4149-88C4-B6D09E0E9BA6}.Debug|Win32.ActiveCfg = Debug|Win32
{56F6B346-D0EA-4149-88C4-B6D09E0E9BA6}.Debug|Win32.Build.0 = Debug|Win32
{56F6B346-D0EA-4149-88C4-B6D09E0E9BA6}.Release|Win32.ActiveCfg = Release|Win32
{56F6B346-D0EA-4149-88C4-B6D09E0E9BA6}.Release|Win32.Build.0 = Release|Win32
{CF068422-CD0A-484E-B4A9-A0CD108EBBB9}.Debug|Win32.ActiveCfg = Debug|Win32
{CF068422-CD0A-484E-B4A9-A0CD108EBBB9}.Debug|Win32.Build.0 = Debug|Win32
{CF068422-CD0A-484E-B4A9-A0CD108EBBB9}.Release|Win32.ActiveCfg = Release|Win32
{CF068422-CD0A-484E-B4A9-A0CD108EBBB9}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
// ASCDocxRenderer.cpp : Implementation of CASCDocxRenderer
#include "stdafx.h"
#include "ASCDocxRenderer.h"
// CAVSDocxRenderer
STDMETHODIMP CAVSDocxRenderer::get_Type(LONG* lType)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::NewPage()
{
this->ooxDocument.AddPage();
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_Height(double* dHeight)
{
if ( dHeight != NULL )
{
*dHeight = this->ooxDocument.GetHeight();
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_Height(double dHeight)
{
this->ooxDocument.SetHeight( dHeight );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_Width(double* dWidth)
{
if ( dWidth != NULL )
{
*dWidth = this->ooxDocument.GetWidth();
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_Width(double dWidth)
{
this->ooxDocument.SetWidth( dWidth );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_DpiX(double* dDpiX)
{
//!!!TODO!!!
if ( dDpiX != NULL )
{
*dDpiX = 300;
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_DpiY(double* dDpiY)
{
//!!!TODO!!!
if ( dDpiY != NULL )
{
*dDpiY = 300;
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetPen(BSTR bsXML)
{
XmlUtils::CXmlReader oXmlReader;
if( TRUE == oXmlReader.OpenFromXmlString( bsXML ) )
{
if( TRUE == oXmlReader.ReadRootNode( _T( "pen" ) ) )
{
CString penColor = oXmlReader.ReadNodeAttributeOrValue( _T( "color" ) );
CString penSize = oXmlReader.ReadNodeAttributeOrValue( _T( "size" ) );
if ( !penColor.IsEmpty() )
{
this->ooxDocument.SetPenColor( ToString( DocxRenderer::Utils::ToHexString( DocxRenderer::Utils::little_endian_2_big_endian( Parse<int>( penColor.GetString() ) ) ) ) );
}
if ( !penSize.IsEmpty() )
{
this->ooxDocument.SetPenSize( Parse<double>( penSize.GetString() ) );
}
}
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenColor(LONG* lColor)
{
if ( lColor != NULL )
{
*lColor = this->penColor;
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenColor(LONG lColor)
{
this->penColor = lColor;
this->ooxDocument.SetPenColor( ToString( DocxRenderer::Utils::ToHexString( DocxRenderer::Utils::little_endian_2_big_endian( this->penColor ) ) ) );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenAlpha(LONG* lAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenAlpha(LONG lAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenSize(double* dSize)
{
if ( dSize != NULL )
{
*dSize = this->penSize;
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenSize(double dSize)
{
this->penSize = dSize;
this->ooxDocument.SetPenSize( this->penSize );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenDashStyle(BYTE* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenDashStyle(BYTE val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenLineStartCap(BYTE* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenLineStartCap(BYTE val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenLineEndCap(BYTE* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenLineEndCap(BYTE val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenLineJoin(BYTE* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenLineJoin(BYTE val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenDashOffset(double* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenDashOffset(double val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenAlign(LONG* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenAlign(LONG val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_PenMiterLimit(double* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_PenMiterLimit(double val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PenDashPattern(SAFEARRAY* pPattern)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetBrush(BSTR bsXML)
{
XmlUtils::CXmlReader oXmlReader;
if( TRUE == oXmlReader.OpenFromXmlString( bsXML ) )
{
if( TRUE == oXmlReader.ReadRootNode( _T( "brush" ) ) )
{
CString brushColor = oXmlReader.ReadNodeAttributeOrValue( _T( "color1" ) );
if ( !brushColor.IsEmpty() )
{
int brushColorInt = Parse<int>( brushColor.GetString() );
this->ooxDocument.SetBrushColor( ToString( DocxRenderer::Utils::ToHexString( DocxRenderer::Utils::little_endian_2_big_endian( brushColorInt ) ) ) );
this->ooxDocument.SetFontColor( ToString( DocxRenderer::Utils::ToHexString( DocxRenderer::Utils::little_endian_2_big_endian( brushColorInt ) ) ) );
}
}
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushType(LONG* lType)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushType(LONG lType)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushColor1(LONG* lColor)
{
if ( lColor != NULL )
{
*lColor = this->brushColor;
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushColor1(LONG lColor)
{
this->brushColor = lColor;
this->ooxDocument.SetBrushColor( ToString( DocxRenderer::Utils::ToHexString( DocxRenderer::Utils::little_endian_2_big_endian( this->brushColor ) ) ) );
this->ooxDocument.SetFontColor( ToString( DocxRenderer::Utils::ToHexString( DocxRenderer::Utils::little_endian_2_big_endian( this->brushColor ) ) ) );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushAlpha1(LONG* lAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushAlpha1(LONG lAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushColor2(LONG* lColor)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushColor2(LONG lColor)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushAlpha2(LONG* lAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushAlpha2(LONG lAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushTexturePath(BSTR* bsPath)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushTexturePath(BSTR bsPath)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushTextureMode(LONG* lMode)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushTextureMode(LONG lMode)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushTextureAlpha(LONG* lTxAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushTextureAlpha(LONG lTxAlpha)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_BrushLinearAngle(double* dAngle)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_BrushLinearAngle(double dAngle)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::BrushRect(BOOL val, double left, double top, double width, double height)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetFont(BSTR bsXML)
{
XmlUtils::CXmlReader oXmlReader;
if( TRUE == oXmlReader.OpenFromXmlString( bsXML ) )
{
if( TRUE == oXmlReader.ReadRootNode( _T( "font" ) ) )
{
CString fontName = oXmlReader.ReadNodeAttributeOrValue( _T( "name" ) );
CString fontSize = oXmlReader.ReadNodeAttributeOrValue( _T( "size" ) );
CString bold = oXmlReader.ReadNodeAttributeOrValue( _T( "bold" ) );
CString italic = oXmlReader.ReadNodeAttributeOrValue( _T( "italic" ) );
CString underline = oXmlReader.ReadNodeAttributeOrValue( _T( "underline" ) );
CString strikeout = oXmlReader.ReadNodeAttributeOrValue( _T( "strikeout" ) );
if ( !fontName.IsEmpty() )
{
this->ooxDocument.SetFontName( ToString( fontName.GetString() ) );
}
if ( !fontSize.IsEmpty() )
{
this->ooxDocument.SetFontSize( Parse<double>( ToString( fontSize.GetString() ) ) );
}
if ( !bold.IsEmpty() )
{
this->ooxDocument.SetBold( ( Parse<int>( ToString( bold.GetString() ) ) != 0 ) ? ( true ) : ( false ) );
}
if ( !italic.IsEmpty() )
{
this->ooxDocument.SetItalic( ( Parse<int>( ToString( italic.GetString() ) ) != 0 ) ? ( true ) : ( false ) );
}
if ( !strikeout.IsEmpty() )
{
this->ooxDocument.SetStrikeout( ( Parse<int>( ToString( strikeout.GetString() ) ) != 0 ) ? ( true ) : ( false ) );
}
if ( !underline.IsEmpty() )
{
this->ooxDocument.SetUnderline( ( Parse<int>( ToString( underline.GetString() ) ) != 0 ) ? ( true ) : ( false ) );
}
}
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_FontName(BSTR* bsName)
{
if ( bsName != NULL )
{
*bsName = SysAllocString( this->fontName.c_str() );
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_FontName(BSTR bsName)
{
this->fontName = std::wstring( bsName );
this->ooxDocument.SetFontName( ToString( this->fontName ) );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_FontPath(BSTR* bsName)
{
if ( bsName != NULL )
{
*bsName = SysAllocString( this->fontPath.c_str() );
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_FontPath(BSTR bsName)
{
this->fontPath = std::wstring( bsName );
if ( this->fontSize != 0 )
{
this->ooxDocument.LoadFontFromFile( this->fontPath, this->fontSize );
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_FontSize(double* dSize)
{
if ( dSize != NULL )
{
*dSize = this->fontSize;
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_FontSize(double dSize)
{
this->fontSize = dSize;
this->ooxDocument.SetFontSize( dSize );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_FontStyle(LONG* lStyle)
{
if ( lStyle != NULL )
{
*lStyle = this->fontStyle;
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_FontStyle(LONG lStyle)
{
this->fontStyle = lStyle;
this->ooxDocument.SetBold( false );
this->ooxDocument.SetItalic( false );
this->ooxDocument.SetUnderline( false );
this->ooxDocument.SetStrikeout( false );
if ( this->fontStyle & 1 == 1 )
{
this->ooxDocument.SetBold( true );
}
if ( this->fontStyle >> 1 == 1 )
{
this->ooxDocument.SetItalic( true );
}
if ( this->fontStyle >> 2 == 1 )
{
this->ooxDocument.SetUnderline( true );
}
if ( this->fontStyle >> 3 == 1 )
{
this->ooxDocument.SetStrikeout( true );
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_FontStringGID(BOOL* bGID)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_FontStringGID(BOOL bGID)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_FontCharSpace(double* dSpace)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_FontCharSpace(double dSpace)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetShadow(BSTR bsXML)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ShadowDistanceX(double* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ShadowDistanceX(double val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ShadowDistanceY(double* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ShadowDistanceY(double val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ShadowBlurSize(double* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ShadowBlurSize(double val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ShadowColor(LONG* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ShadowColor(LONG val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ShadowAlpha(LONG* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ShadowAlpha(LONG val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ShadowVisible(BOOL* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ShadowVisible(BOOL val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetEdgeText(BSTR bsXML)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_EdgeVisible(LONG* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_EdgeVisible(LONG val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_EdgeColor(LONG* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_EdgeColor(LONG val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_EdgeAlpha(LONG* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_EdgeAlpha(LONG val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_EdgeDist(double* val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_EdgeDist(double val)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::CommandDrawText(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset)
{
if ( bsText != NULL )
{
std::wstring text;
for ( unsigned int i = 0; i < SysStringLen( bsText ); i++ )
{
if ( DocxRenderer::Utils::IsUnicodeSymbol( bsText[i] ) )
{
text += bsText[i];
}
}
if ( !text.empty() )
{
this->ooxDocument.AddText( text, fX, fY, fWidth, fHeight, fBaseLineOffset );
}
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::CommandDrawTextEx(BSTR bsUnicodeText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags)
{
if ( ( bsUnicodeText != NULL ) && ( bsGidText != NULL ) )
{
std::wstring text;
for ( unsigned int i = 0; i < SysStringLen( bsUnicodeText ); i++ )
{
if ( DocxRenderer::Utils::IsUnicodeSymbol( bsUnicodeText[i] ) )
{
text += bsUnicodeText[i];
}
}
if ( !text.empty() )
{
this->ooxDocument.AddText( text, fX, fY, fWidth, fHeight, fBaseLineOffset );
}
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::BeginCommand(DWORD lType)
{
this->ooxDocument.BeginCommand( lType );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::EndCommand(DWORD lType)
{
this->ooxDocument.EndCommand( lType );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandMoveTo(double fX, double fY)
{
this->ooxDocument.PathMoveTo( fX, fY );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandLineTo(double fX, double fY)
{
this->ooxDocument.PathLineTo( fX, fY );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandLinesTo(SAFEARRAY* pPoints)
{
if ( pPoints != NULL )
{
LONG lCount = pPoints->rgsabound[0].cElements;
double* pData = (double*)(pPoints->pvData);
std::vector<double> points;
for ( LONG i = 0; i < (LONG)( lCount ); i++ )
{
points.push_back( pData[i] );
}
this->ooxDocument.PathLinesTo( points );
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandCurveTo(double fX1, double fY1, double fX2, double fY2, double fX3, double fY3)
{
this->ooxDocument.PathCurveTo( fX1, fY1, fX2, fY2, fX3, fY3 );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandCurvesTo(SAFEARRAY* pPoints)
{
if ( pPoints != NULL )
{
LONG lCount = pPoints->rgsabound[0].cElements;
double* pData = (double*)(pPoints->pvData);
std::vector<double> points;
for ( LONG i = 0; i < (LONG)( lCount ); i++ )
{
points.push_back( pData[i] );
}
this->ooxDocument.PathCurvesTo( points );
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandArcTo(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle)
{
this->ooxDocument.PathArcTo( fX, fY, fWidth, fHeight, fStartAngle, fSweepAngle );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandClose()
{
this->ooxDocument.PathClose();
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandEnd()
{
this->ooxDocument.PathEnd();
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::DrawPath(long nType)
{
this->ooxDocument.DrawPath( nType );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandStart()
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandGetCurrentPoint(double* fX, double* fY)
{
this->ooxDocument.PathGetCurrentPoint( fX, fY );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::GetCommandParams(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags)
{
this->ooxDocument.GetCommandParams( dAngle, dLeft, dTop, dWidth, dHeight, lFlags );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetCommandParams(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags)
{
this->ooxDocument.SetCommandParams( dAngle, dLeft, dTop, dWidth, dHeight, lFlags );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::DrawImage(IUnknown* pInterface, double fX, double fY, double fWidth, double fHeight)
{
if ( pInterface != NULL )
{
AVSImageStudio3::IImageTransformsPtr piImageStudio = NULL;
piImageStudio.CreateInstance(__uuidof(AVSImageStudio3::ImageTransforms));
VARIANT_BOOL vbSuccess = VARIANT_FALSE;
VARIANT vtFrame;
vtFrame.vt = VT_UNKNOWN;
vtFrame.punkVal = pInterface;
piImageStudio->SetSource( 0, vtFrame );
CString sSaveXml;
this->imageFiles.push_back( DocxRenderer::Utils::GetTempFile( tempPath, _T( "IMG" ), true ) );
std::wstring sPngPath = this->imageFiles.back() + _T( ".png" );
// , boost ,
if( boost::filesystem::exists(sPngPath ))
boost::filesystem::remove(sPngPath);
boost::filesystem::rename( this->imageFiles.back(), sPngPath );
this->imageFiles.back() += _T( ".png" );
sSaveXml.AppendFormat( _T("<ImageFile-SaveAsPng destinationpath=\"%s\" format=\"888\" quality=\"100\" />"), this->imageFiles.back().c_str() );
BSTR bstrSaveXml = sSaveXml.AllocSysString();
piImageStudio->SetXml( bstrSaveXml, &vbSuccess );
if( VARIANT_TRUE == vbSuccess )
{
piImageStudio->Transform( &vbSuccess );
if( VARIANT_TRUE == vbSuccess )
{
if( SUCCEEDED( piImageStudio->GetResult( 0, &vtFrame ) ) )
{
RELEASEINTERFACE( vtFrame.punkVal );
vbSuccess = VARIANT_TRUE;
this->DrawImageFromFile( _bstr_t( this->imageFiles.back().c_str() ), fX, fY, fWidth, fHeight );
}
SysFreeString( bstrSaveXml );
}
}
piImageStudio.Release();
return S_OK;
}
else
{
return S_FALSE;
}
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::DrawImageFromFile(BSTR bstrVal, double fX, double fY, double fWidth, double fHeight)
{
this->ooxDocument.AddImage( std::wstring( bstrVal ), fX, fY, fWidth, fHeight );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetAdditionalParam(BSTR ParamName, VARIANT ParamValue)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::GetAdditionalParam(BSTR ParamName, VARIANT* ParamValue)
{
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::SetTransform(double dA, double dB, double dC, double dD, double dE, double dF)
{
this->ooxDocument.SetTransform( dA, dB, dC, dD, dE, dF );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::GetTransform(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF)
{
this->ooxDocument.GetTransform( pdA, pdB, pdC, pdD, pdE, pdF );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::ResetTransform(void)
{
this->ooxDocument.ResetTransform();
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::get_ClipMode(LONG* plMode)
{
if ( plMode != NULL )
{
*plMode = this->ooxDocument.GetClipMode();
}
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::put_ClipMode(LONG lMode)
{
this->ooxDocument.SetClipMode( lMode );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandText(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset)
{
this->ooxDocument.PathText( std::wstring( bsText ), fX, fY, fWidth, fHeight, fBaseLineOffset );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::PathCommandTextEx(BSTR bsUnicodeText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags)
{
this->PathCommandText( bsUnicodeText, fX, fY, fWidth, fHeight, fBaseLineOffset );
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::Initialize(BSTR bsXMLOptions)
{
XmlUtils::CXmlReader oXmlReader;
if( TRUE == oXmlReader.OpenFromXmlString( bsXMLOptions ) )
{
if( TRUE == oXmlReader.ReadRootNode( _T( "DocxRenderer" ) ) )
{
CString destinationPath = oXmlReader.ReadNodeAttributeOrValue( _T( "destinationpath" ) );
if ( !destinationPath.IsEmpty() )
{
this->ooxDocument.SetDestinationPath( ::ToWString( destinationPath.GetString() ) );
//
int nIndex = -1;
int nIndex1 = destinationPath.ReverseFind( '\\' );
int nIndex2 = destinationPath.ReverseFind( '/' );
if( -1 != nIndex1 || -1 != nIndex2 )
{
if( nIndex1 > nIndex2 )
nIndex = nIndex1;
else
nIndex = nIndex2;
}
if( -1 != nIndex )
tempPath = destinationPath.Mid( 0, nIndex ).GetBuffer();
}
CString textFormatting = oXmlReader.ReadNodeAttributeOrValue( _T( "textformatting" ) );
if ( !textFormatting.IsEmpty() )
{
this->ooxDocument.SetTextAssociationType( (DocxRenderer::TextAssociationType)Parse<int>( textFormatting.GetString() ) );
}
}
}
this->pOfficeUtils.CreateInstance( __uuidof(AVSOfficeUtils::COfficeUtils) );
criticalSection.Enter();
if( L"" == tempPath )
tempPath = DocxRenderer::Utils::GetTempDir();
tempFile = DocxRenderer::Utils::GetTempFile( tempPath, _T( "DOCX" ), true );
tempDir = DocxRenderer::Utils::GetTempFile( tempPath, _T( "DOCX" ), false );
if ( !tempPath.empty() && !tempFile.empty() && !tempDir.empty() )
{
this->CreateOriginDocx( tempFile, tempDir );
}
this->ooxDocument.CreateFromTemplate( tempDir );
criticalSection.Leave();
return S_OK;
}
/*========================================================================================================*/
STDMETHODIMP CAVSDocxRenderer::Save()
{
this->ooxDocument.Save();
BOOST_FOREACH( const std::wstring& fileName, this->imageFiles )
{
boost::filesystem::remove( fileName );
}
return S_OK;
}
/*========================================================================================================*/
const unsigned long CAVSDocxRenderer::LoadFromResource( LPCWSTR lpResName, LPCWSTR lpResType, LPCWSTR fileName ) const
{
HMODULE hMod = GetModuleHandle( _T( "AVSOfficeDocxRenderer.dll" ) );
if ( hMod )
{
HRSRC hRes = FindResource( hMod, lpResName, lpResType );
if ( hRes )
{
HGLOBAL hGlob = LoadResource( hMod, hRes );
if (hGlob)
{
BYTE *lpbArray = (BYTE*)LockResource( hGlob );
if ( lpbArray )
{
const DWORD dwFileSize = SizeofResource( hMod, hRes );
if ( dwFileSize != 0 )
{
int hFile = 0;
errno_t err = _wsopen_s(&hFile, fileName, (O_BINARY | O_CREAT | _O_RDWR ), _SH_DENYNO, S_IWRITE);
if ( !err )
{
_write( hFile, lpbArray, dwFileSize );
_close( hFile );
}
}
}
}
}
}
return GetLastError();
}
/*========================================================================================================*/
void CAVSDocxRenderer::CreateOriginDocx( const std::wstring& tempFileName, const std::wstring& tempDirName ) const
{
boost::filesystem::create_directories( tempDirName );
unsigned long error = this->LoadFromResource( MAKEINTRESOURCE( IDR_DOCUMENT1 ), _T( "Document" ), tempFileName.c_str() );
this->pOfficeUtils->ExtractToDirectory( _bstr_t( tempFileName.c_str() ), _bstr_t( tempDirName.c_str() ), NULL, 0 );
boost::filesystem::remove( tempFileName );
}
// ASCDocxRenderer.h : Declaration of the CAVSDocxRenderer
#pragma once
#include "resource.h" // main symbols
#include "..\..\ASCImageStudio3\ASCGraphics\Interfaces\ASCRenderer.h"
#include "..\..\Common\ASCUtils.h"
#include "..\..\Common\xmlutils.h"
#import ".\..\..\Redist\ASCOfficeUtils.dll" raw_interfaces_only
#import ".\..\..\Redist\ASCImageStudio3.dll" raw_interfaces_only
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "Docx.h"
#pragma comment(lib, "Utility.lib")
#pragma comment(lib, "Common.lib")
#pragma comment(lib, "DocxFormat.lib")
#pragma comment(lib, "XML.lib")
#pragma comment(lib, "OfficeSvmFile.lib")
#include "Document.h"
#include "ASCOfficeCriticalSection.h"
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
#endif
// IAVSDocxRenderer
[
object,
uuid("5BEC40F1-CA4F-4275-BCC8-D4ABF47D896D"),
dual, helpstring("IAVSDocxRenderer Interface"),
pointer_default(unique)
]
__interface IAVSDocxRenderer : IAVSRenderer
{
[id(11001), helpstring("method Initialize")] HRESULT Initialize([in]BSTR bsXMLOptions);
[id(11002), helpstring("method Save")] HRESULT Save();
};
AVSOfficeCriticalSection criticalSection;
// CAVSDocxRenderer
[
coclass,
default(IAVSDocxRenderer),
threading(apartment),
vi_progid("AVSOfficeDocxRenderer.AVSDocxRenderer"),
progid("AVSOfficeDocxRenderer.AVSDocxRenderer.1"),
version(1.0),
uuid("77B37E21-16F0-4BCC-8901-DFD89B962174"),
helpstring("AVSDocxRenderer Class")
]
class ATL_NO_VTABLE CAVSDocxRenderer :
public IAVSDocxRenderer
{
public:
CAVSDocxRenderer():
ooxDocument(DocxRenderer::TextAssociationTypeNoFrames)
{
}
DECLARE_PROTECT_FINAL_CONSTRUCT()
HRESULT FinalConstruct()
{
this->fontSize = 0;
this->fontStyle = 0;
this->penColor = 0;
this->penSize = 0;
this->brushColor = 0;
tempPath = L"";
tempFile = L"";
tempDir = L"";
return S_OK;
}
void FinalRelease()
{
this->pOfficeUtils.Release();
criticalSection.Enter();
if( boost::filesystem::is_directory(this->tempDir) )
boost::filesystem::remove_all( boost::filesystem::wpath( this->tempDir ) );
criticalSection.Leave();
}
public:
// IAVSRenderer Methods
// -----------------------------------------------------------------------------
STDMETHOD(get_Type)(LONG* lType);
//-------- --------------------------------------------------
STDMETHOD(NewPage)();
STDMETHOD(get_Height)(double* dHeight);
STDMETHOD(put_Height)(double dHeight);
STDMETHOD(get_Width)(double* dWidth);
STDMETHOD(put_Width)(double dWidth);
STDMETHOD(get_DpiX)(double* dDpiX);
STDMETHOD(get_DpiY)(double* dDpiY);
//-------- ----------------------------------------------
STDMETHOD(SetPen)(BSTR bsXML);
STDMETHOD(get_PenColor)(LONG* lColor);
STDMETHOD(put_PenColor)(LONG lColor);
STDMETHOD(get_PenAlpha)(LONG* lAlpha);
STDMETHOD(put_PenAlpha)(LONG lAlpha);
STDMETHOD(get_PenSize)(double* dSize);
STDMETHOD(put_PenSize)(double dSize);
STDMETHOD(get_PenDashStyle)(BYTE* val);
STDMETHOD(put_PenDashStyle)(BYTE val);
STDMETHOD(get_PenLineStartCap)(BYTE* val);
STDMETHOD(put_PenLineStartCap)(BYTE val);
STDMETHOD(get_PenLineEndCap)(BYTE* val);
STDMETHOD(put_PenLineEndCap)(BYTE val);
STDMETHOD(get_PenLineJoin)(BYTE* val);
STDMETHOD(put_PenLineJoin)(BYTE val);
STDMETHOD(get_PenDashOffset)(double* val);
STDMETHOD(put_PenDashOffset)(double val);
STDMETHOD(get_PenAlign)(LONG* val);
STDMETHOD(put_PenAlign)(LONG val);
STDMETHOD(get_PenMiterLimit)(double* val);
STDMETHOD(put_PenMiterLimit)(double val);
STDMETHOD(PenDashPattern)(SAFEARRAY* pPattern);
STDMETHOD(SetBrush)(BSTR bsXML);
STDMETHOD(get_BrushType)(LONG* lType);
STDMETHOD(put_BrushType)(LONG lType);
STDMETHOD(get_BrushColor1)(LONG* lColor);
STDMETHOD(put_BrushColor1)(LONG lColor);
STDMETHOD(get_BrushAlpha1)(LONG* lAlpha);
STDMETHOD(put_BrushAlpha1)(LONG lAlpha);
STDMETHOD(get_BrushColor2)(LONG* lColor);
STDMETHOD(put_BrushColor2)(LONG lColor);
STDMETHOD(get_BrushAlpha2)(LONG* lAlpha);
STDMETHOD(put_BrushAlpha2)(LONG lAlpha);
STDMETHOD(get_BrushTexturePath)(BSTR* bsPath);
STDMETHOD(put_BrushTexturePath)(BSTR bsPath);
STDMETHOD(get_BrushTextureMode)(LONG* lMode);
STDMETHOD(put_BrushTextureMode)(LONG lMode);
STDMETHOD(get_BrushTextureAlpha)(LONG* lTxAlpha);
STDMETHOD(put_BrushTextureAlpha)(LONG lTxAlpha);
STDMETHOD(get_BrushLinearAngle)(double* dAngle);
STDMETHOD(put_BrushLinearAngle)(double dAngle);
STDMETHOD(BrushRect)(BOOL val, double left, double top, double width, double height);
STDMETHOD(SetFont)(BSTR bsXML);
STDMETHOD(get_FontName)(BSTR* bsName);
STDMETHOD(put_FontName)(BSTR bsName);
STDMETHOD(get_FontPath)(BSTR* bsName);
STDMETHOD(put_FontPath)(BSTR bsName);
STDMETHOD(get_FontSize)(double* dSize);
STDMETHOD(put_FontSize)(double dSize);
STDMETHOD(get_FontStyle)(LONG* lStyle);
STDMETHOD(put_FontStyle)(LONG lStyle);
STDMETHOD(get_FontStringGID)(BOOL* bGID);
STDMETHOD(put_FontStringGID)(BOOL bGID);
STDMETHOD(get_FontCharSpace)(double* dSpace);
STDMETHOD(put_FontCharSpace)(double dSpace);
STDMETHOD(SetShadow)(BSTR bsXML);
STDMETHOD(get_ShadowDistanceX)(double* val);
STDMETHOD(put_ShadowDistanceX)(double val);
STDMETHOD(get_ShadowDistanceY)(double* val);
STDMETHOD(put_ShadowDistanceY)(double val);
STDMETHOD(get_ShadowBlurSize)(double* val);
STDMETHOD(put_ShadowBlurSize)(double val);
STDMETHOD(get_ShadowColor)(LONG* val);
STDMETHOD(put_ShadowColor)(LONG val);
STDMETHOD(get_ShadowAlpha)(LONG* val);
STDMETHOD(put_ShadowAlpha)(LONG val);
STDMETHOD(get_ShadowVisible)(BOOL* val);
STDMETHOD(put_ShadowVisible)(BOOL val);
STDMETHOD(SetEdgeText)(BSTR bsXML);
STDMETHOD(get_EdgeVisible)(LONG* val);
STDMETHOD(put_EdgeVisible)(LONG val);
STDMETHOD(get_EdgeColor)(LONG* val);
STDMETHOD(put_EdgeColor)(LONG val);
STDMETHOD(get_EdgeAlpha)(LONG* val);
STDMETHOD(put_EdgeAlpha)(LONG val);
STDMETHOD(get_EdgeDist)(double* val);
STDMETHOD(put_EdgeDist)(double val);
//-------- --------------------------------------------------------
STDMETHOD(CommandDrawText)(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset);
STDMETHOD(CommandDrawTextEx)(BSTR bsUnicodeText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags);
//-------- ---------------------------------------------------------------
STDMETHOD(BeginCommand)(DWORD lType);
STDMETHOD(EndCommand)(DWORD lType);
//-------- Graphics Path -----------------------------------------------
STDMETHOD(PathCommandMoveTo)(double fX, double fY);
STDMETHOD(PathCommandLineTo)(double fX, double fY);
STDMETHOD(PathCommandLinesTo)(SAFEARRAY* pPoints);
STDMETHOD(PathCommandCurveTo)(double fX1, double fY1, double fX2, double fY2, double fX3, double fY3);
STDMETHOD(PathCommandCurvesTo)(SAFEARRAY* pPoints);
STDMETHOD(PathCommandArcTo)(double fX, double fY, double fWidth, double fHeight, double fStartAngle, double fSweepAngle);
STDMETHOD(PathCommandClose)();
STDMETHOD(PathCommandEnd)();
STDMETHOD(DrawPath)(long nType);
STDMETHOD(PathCommandStart)();
STDMETHOD(PathCommandGetCurrentPoint)(double* fX, double* fY);
STDMETHOD(PathCommandText)(BSTR bsText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset);
STDMETHOD(PathCommandTextEx)(BSTR bsUnicodeText, BSTR bsGidText, BSTR bsSourceCodeText, double fX, double fY, double fWidth, double fHeight, double fBaseLineOffset, DWORD lFlags);
STDMETHOD(GetCommandParams)(double* dAngle, double* dLeft, double* dTop, double* dWidth, double* dHeight, DWORD* lFlags);
STDMETHOD(SetCommandParams)(double dAngle, double dLeft, double dTop, double dWidth, double dHeight, DWORD lFlags);
//-------- --------------------------------------------------
STDMETHOD(DrawImage)(IUnknown* pInterface, double fX, double fY, double fWidth, double fHeight);
STDMETHOD(DrawImageFromFile)(BSTR bstrVal, double fX, double fY, double fWidth, double fHeight);
//------------------------------------------------------------------------------------------
STDMETHOD(SetAdditionalParam)(BSTR ParamName, VARIANT ParamValue);
STDMETHOD(GetAdditionalParam)(BSTR ParamName, VARIANT* ParamValue);
STDMETHOD(SetTransform)(double dA, double dB, double dC, double dD, double dE, double dF);
STDMETHOD(GetTransform)(double *pdA, double *pdB, double *pdC, double *pdD, double *pdE, double *pdF);
STDMETHOD(ResetTransform)(void);
STDMETHOD(get_ClipMode)(LONG* plMode);
STDMETHOD(put_ClipMode)(LONG lMode);
//IAVSDocxRenderer Methods
STDMETHOD(Initialize)(BSTR bsXMLOptions);
STDMETHOD(Save)();
private:
const unsigned long LoadFromResource( LPCWSTR lpResName, LPCWSTR lpResType, LPCWSTR fileName ) const;
void CreateOriginDocx( const std::wstring& tempFileName, const std::wstring& tempDirName ) const;
private:
std::vector<std::wstring> imageFiles;
AVSOfficeUtils::IOfficeUtilsPtr pOfficeUtils;
AVSGraphics::IAVSFontManagerPtr pFontManager;
DocxRenderer::Document ooxDocument;
std::wstring fontPath;
double fontSize;
std::wstring fontName;
long fontStyle;
long penColor;
double penSize;
long brushColor;
std::wstring tempPath;
std::wstring tempFile;
std::wstring tempDir;
};
#pragma once
class AVSOfficeCriticalSection
{
private:
CRITICAL_SECTION CriticalSection;
public:
AVSOfficeCriticalSection()
{
InitializeCriticalSection( &(this->CriticalSection) );
}
~AVSOfficeCriticalSection()
{
DeleteCriticalSection( &(this->CriticalSection) );
}
void Enter()
{
EnterCriticalSection( &(this->CriticalSection) );
}
void Leave()
{
LeaveCriticalSection( &(this->CriticalSection) );
}
};
\ No newline at end of file
// ASCOfficeDocxRenderer.cpp : Implementation of DLL Exports.
#include "stdafx.h"
#include "resource.h"
// The module attribute causes DllMain, DllRegisterServer and DllUnregisterServer to be automatically implemented for you
[ module(dll, uuid = "{F522F14B-4A53-4DC8-960B-C5A46B447BEC}",
name = "ASCOfficeDocxRenderer",
helpstring = "ASCOfficeDocxRenderer 1.0 Type Library",
resource_name = "IDR_ASCOFFICEDOCXRENDERER") ]
class CAVSOfficeDocxRendererModule
{
public:
// Override CAtlDllModuleT members
};
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
#define COMPONENT_NAME "OfficeDocxRenderer"
#include "../../../Common/FileInfo.h"
#include "version.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE 9, 1
#pragma code_page(1251)
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
3 TEXTINCLUDE
BEGIN
"\r\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Document
//
IDR_DOCUMENT1 Document
BEGIN
0x4b50, 0x0403, 0x000a, 0x0000, 0x0000, 0x7cc1, 0x3d69, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0009, 0x0000, 0x6f64, 0x5063, 0x6f72,
0x7370, 0x502f, 0x034b, 0x1404, 0x0000, 0x0800, 0x0000, 0x2100, 0x8c00,
0x8bba, 0x65f1, 0x0001, 0xc500, 0x0002, 0x1000, 0x0000, 0x6400, 0x636f,
0x7250, 0x706f, 0x2f73, 0x7061, 0x2e70, 0x6d78, 0x9d6c, 0x4d92, 0xc26f,
0x0c30, 0xef86, 0xf693, 0xaa1f, 0x69de, 0x870a, 0x4269, 0x6821, 0x4d02,
0xec3b, 0x8903, 0xce32, 0xe251, 0xd1b6, 0x24d2, 0x024a, 0xffa2, 0x6e7e,
0x42ab, 0x6e27, 0xc9eb, 0x1c7e, 0x79bf, 0x86ed, 0x2fae, 0x4e8d, 0xe0ce,
0xb283, 0x9566, 0xb3ce, 0x4d3c, 0x08c0, 0x952b, 0x56a9, 0xa1e9, 0x9d78,
0xa73d, 0x8849, 0x48dc, 0xadae, 0x5581, 0x42da, 0xd748, 0xf1ec, 0xee81,
0x75bc, 0xa3e0, 0x9082, 0x84a0, 0xab09, 0x8eb4, 0x2dd1, 0x0909, 0x86a2,
0x8786, 0xcb0c, 0x2b06, 0xf5a5, 0x8f0d, 0xfa98, 0xd88a, 0x54b2, 0xb602,
0x9c56, 0x301a, 0x2c91, 0xfcf2, 0xc089, 0x8225, 0x2091, 0xee67, 0x982a,
0x8a0e, 0x73cb, 0xaffc, 0xb4a8, 0xf3a2, 0xbe17, 0xd68b, 0x1ea1, 0x05a3,
0x4e34, 0x08f3, 0xb3ec, 0xd4eb, 0xb499, 0xa1b1, 0xa464, 0xb758, 0xeb91,
0x3542, 0xe6c0, 0xaf88, 0xdd09, 0x0af1, 0xc742, 0x8086, 0xad1e, 0x8197,
0x94e5, 0x010c, 0xd4dd, 0x73dc, 0xc111, 0x70f7, 0xd192, 0xe717, 0x12b4,
0xe23c, 0xd95e, 0x1287, 0x06de, 0xc65b, 0xabe4, 0x9b37, 0xdd74, 0x4c94,
0x508f, 0x601c, 0xe20f, 0x55e4, 0x3b6c, 0x69a9, 0xdf4a, 0x1995, 0xf45c,
0xba01, 0x6bc2, 0xcf2a, 0xdd5d, 0x49c3, 0xf746, 0x6b82, 0xe0d8, 0xace8,
0x3ae4, 0x2500, 0x8057, 0x6d5e, 0xb8e3, 0x3941, 0x4432, 0xf083, 0x384f,
0xc2b8, 0x716e, 0x630b, 0x1fcb, 0x1d38, 0xa8f1, 0xbd62, 0x5c77, 0x30c0,
0x3dec, 0x0cef, 0x0520, 0xee89, 0xb547, 0xa01b, 0x2d6f, 0x60fe, 0xa9dd,
0xaf63, 0x40a9, 0x678e, 0x0aee, 0xfafd, 0x87be, 0xc957, 0x8be6, 0xc72c,
0x928f, 0xc31b, 0x6e19, 0x8fef, 0x02fd, 0x4b50, 0x0403, 0x0014, 0x0000,
0x0008, 0x7cc1, 0x3d69, 0xc57d, 0x2286, 0x0123, 0x0000, 0x0233, 0x0000,
0x0011, 0x0000, 0x6f64, 0x5063, 0x6f72, 0x7370, 0x632f, 0x726f, 0x2e65,
0x6d78, 0x6d6c, 0x4f91, 0xc34f, 0x0c30, 0xefc5, 0x7c48, 0x2a87, 0x35f7,
0x482b, 0x5508, 0x276d, 0xe071, 0x24c4, 0x4024, 0x1ae2, 0x6f12, 0x6b0b,
0x28fe, 0xd6f6, 0xdbf5, 0x4493, 0x0ed0, 0xcdd8, 0xefcf, 0xa7e7, 0x6ec4,
0x2756, 0x17d3, 0x0847, 0x9da8, 0x596d, 0x2e55, 0x0159, 0x3a56, 0xeda5,
0x65b6, 0xaf6f, 0x8b8f, 0x567b, 0x0920, 0x44ab, 0x2cef, 0x6cb4, 0x6404,
0xeeab, 0xaafa, 0xbe91, 0x2e96, 0x73c0, 0x1e70, 0x6902, 0x22c0, 0x5926,
0xa5ac, 0xd96f, 0xc88e, 0x9cd7, 0xdca3, 0x1181, 0x4658, 0x46c2, 0xe373,
0x1182, 0x6514, 0x72d8, 0xe42f, 0x6c5e, 0xdf81, 0x972c, 0xdc77, 0x0900,
0x4825, 0x14f0, 0xf0b8, 0x2253, 0x8efb, 0x7254, 0xf48a, 0xd087, 0x00e7,
0x3925, 0x60f4, 0x12c0, 0xaaf2, 0xf8ac, 0x12cc, 0x8304, 0x0717, 0x73b2,
0x1a46, 0xa34d, 0x8b87, 0x8fe8, 0xd139, 0xd427, 0x3813, 0x430c, 0xdc39,
0x3426, 0xbfbd, 0xefe2, 0xa7eb, 0xfc97, 0x85d5, 0x69b6, 0x1257, 0xd758,
0x5928, 0xa693, 0xba1e, 0xcf86, 0xac65, 0xf0f0, 0x09f1, 0x7292, 0x167b,
0x96b1, 0x0401, 0x90b9, 0x598c, 0x35a4, 0x61ef, 0x5c1c, 0x1850, 0x339d,
0x6795, 0xa014, 0xda0c, 0x3c53, 0x745e, 0x377f, 0x6cf2, 0x902f, 0xf1d6,
0x1b9a, 0xea0d, 0x8c61, 0xbfcc, 0xc65e, 0x1c02, 0xa635, 0x2a99, 0xb311,
0xea8c, 0x99ef, 0x2fbb, 0x4b50, 0x0403, 0x000a, 0x0000, 0x0000, 0x7879,
0x3d69, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0005, 0x0000,
0x6f77, 0x6472, 0x502f, 0x034b, 0x1404, 0x0000, 0x0800, 0x0000, 0x2100,
0xb000, 0x31dc, 0xa2f7, 0x0001, 0xd800, 0x0003, 0x1100, 0x0000, 0x7700,
0x726f, 0x2f64, 0x6f64, 0x7563, 0x656d, 0x746e, 0x782e, 0x6c6d, 0x939d,
0x8ecd, 0x20db, 0xc710, 0x95ef, 0x0efa, 0xf716, 0xb8c4, 0x9369, 0xb5ac,
0xaace, 0xd452, 0x2a9e, 0xbaad, 0x03ed, 0x80b0, 0x546d, 0x1060, 0xb8e0,
0xd3e9, 0xc077, 0x1276, 0x6aa9, 0xf515, 0xcc04, 0xefc7, 0x333f, 0xe3c0,
0x4fd3, 0x8ba3, 0xf493, 0x8141, 0x486d, 0xa6b5, 0x90a4, 0x8396, 0xb650,
0xc86b, 0x6ff7, 0x569f, 0x527b, 0xc884, 0x60ac, 0xac1a, 0xc86c, 0x0659,
0x74f2, 0xfb78, 0x71e6, 0x05ac, 0xc1f0, 0x1b48, 0x440b, 0x50d8, 0xd09f,
0xc7db, 0xeae8, 0x0cb2, 0x97bc, 0x8586, 0x3835, 0xd169, 0x82d9, 0x2c37,
0xd1e2, 0xa577, 0xfe61, 0xe0c7, 0x1c56, 0x638c, 0xbd51, 0xad2a, 0xb9e2,
0x477c, 0x96e9, 0x18cc, 0xc868, 0x6de0, 0x233d, 0x4656, 0x0f71, 0xda01,
0x5298, 0x686a, 0xc55b, 0xbce5, 0x192c, 0x1efe, 0x29dd, 0x38e5, 0x9c97,
0x4b15, 0x352f, 0xd88b, 0xe877, 0x0b95, 0xcd0b, 0x2ffc, 0x9d0d, 0x02fd,
0xfd39, 0x89ab, 0xd193, 0xdc4b, 0xeee8, 0x1351, 0x8d9e, 0x1f78, 0x4f46,
0x2342, 0xe178, 0x703c, 0x0219, 0x8f5a, 0xf393, 0xac42, 0x1de8, 0x4c03,
0x4b88, 0x3dc6, 0xdc25, 0xe668, 0x964a, 0x9596, 0x60bd, 0x9fec, 0x7ff7,
0x5ed1, 0xf6a3, 0xb43c, 0xba8c, 0x8236, 0x38b3, 0x5be0, 0x057a, 0x4e71,
0x2bab, 0x1ac6, 0xa2df, 0xdaf8, 0x4a10, 0x3e1f, 0x28ee, 0x93dd, 0x74c5,
0x2d94, 0x741b, 0xf1bc, 0x2994, 0x4825, 0x9f1e, 0xdffd, 0x5ef3, 0x7fd0,
0xcd63, 0xdd2a, 0x2fcb, 0x62f4, 0x55e7, 0x40f5, 0x29b7, 0xc7b2, 0x76fd,
0x41bf, 0x14e6, 0x85f0, 0x6425, 0x9704, 0x3662, 0x33ef, 0x754c, 0x923d,
0x1ff6, 0x8ff0, 0x8aa4, 0x0463, 0xf573, 0xd96a, 0x3c46, 0x68ed, 0x7195,
0x0992, 0x0f89, 0x3773, 0xd1d5, 0xc402, 0x639b, 0xc437, 0xa47c, 0x1a93,
0x1d07, 0x1ad0, 0xe31c, 0xc732, 0x79a0, 0x5ffa, 0xbd9f, 0x8912, 0xacad,
0x567c, 0x6391, 0x9b91, 0x4e6d, 0x972a, 0x71be, 0x4cbb, 0xbcaf, 0xc97e,
0x6fc3, 0x4b50, 0x0403, 0x0014, 0x0000, 0x0008, 0x0000, 0x0021, 0xf926,
0x97bc, 0x016d, 0x0000, 0x0407, 0x0000, 0x0012, 0x0000, 0x6f77, 0x6472,
0x662f, 0x6e6f, 0x5474, 0x6261, 0x656c, 0x782e, 0x6c6d, 0x92b5, 0x6e4d,
0x30c2, 0x8510, 0x95f7, 0x877a, 0xfbc8, 0x2712, 0x90a4, 0x0446, 0x6944,
0xecb3, 0x6aa2, 0xe00f, 0x8718, 0xf258, 0xe44f, 0xa431, 0xbedc, 0x0e36,
0x0162, 0x9b55, 0x6d45, 0xb245, 0xbcdf, 0x9f8c, 0xcd3e, 0xf562, 0x4525,
0x6074, 0xb806, 0x2556, 0x264a, 0x4518, 0x514c, 0xe5bd, 0x576a, 0xcfa2,
0xea8f, 0x4721, 0x5811, 0xb6a2, 0x6844, 0x4ac5, 0x6474, 0x5680, 0xfbcb,
0x45bb, 0x345f, 0x595a, 0xdc88, 0x0aff, 0x530a, 0xd6a2, 0xaeda, 0x6388,
0x2da0, 0x0493, 0xba26, 0xca63, 0x1ad5, 0x246d, 0xeeb1, 0x766a, 0x6eb1,
0x4e1a, 0x8bd9, 0x7ba6, 0x94c9, 0x538d, 0x678c, 0x61b1, 0x5882, 0x36f7,
0xbcb4, 0x3403, 0xeb74, 0xd2ff, 0xd7ad, 0xdb66, 0x4d19, 0x8019, 0x2b0b,
0xe845, 0x0927, 0x6857, 0xa439, 0xfa8b, 0x1142, 0x52e9, 0x707f, 0x20c9,
0x637a, 0xf47d, 0x25ae, 0x8609, 0x288e, 0x2c0d, 0x9e71, 0x1103, 0xc225,
0xdba9, 0x3c33, 0x8fc5, 0x7338, 0xea5f, 0x194e, 0xbd8a, 0xb691, 0x00c4,
0x67b3, 0x66e3, 0xe413, 0x4886, 0x8e2e, 0xd567, 0xbef8, 0xd0a1, 0x4b71,
0xb3db, 0x207e, 0x9386, 0xb05a, 0x0250, 0x73be, 0x3d85, 0xb8d4, 0x2e44,
0x4e2e, 0xf9d7, 0x051c, 0x2925, 0x8e51, 0x1ac3, 0xd494, 0x0a85, 0x1f2b,
0xa994, 0x2e57, 0x7a1e, 0x73ea, 0x26ba, 0x3555, 0xc928, 0xe3c5, 0x8cdf,
0x8903, 0x222b, 0x221b, 0x6d78, 0x0ff8, 0x2a24, 0xe04f, 0x33b4, 0x21c7,
0x451d, 0x7a02, 0x300e, 0xc48a, 0x87da, 0x5f4d, 0x0bab, 0xcc89, 0x780b,
0x7cfe, 0x0245, 0x4aff, 0x3f02, 0x268d, 0x6b21, 0xec97, 0x0936, 0x0b3f,
0x4cc3, 0x46cc, 0x1893, 0x133f, 0x48b7, 0x95f8, 0x0ffd, 0xe189, 0xcb00,
0x506f, 0x034b, 0x1404, 0x0000, 0x0800, 0x0000, 0x2100, 0xe900, 0x8df8,
0x4ec2, 0x0003, 0x3b00, 0x0009, 0x1100, 0x0000, 0x7700, 0x726f, 0x2f64,
0x6573, 0x7474, 0x6e69, 0x7367, 0x782e, 0x6c6d, 0x969d, 0x8f6d, 0x38da,
0xc710, 0x57df, 0x77ea, 0x7940, 0x4a5d, 0x1d1e, 0x35c8, 0x915b, 0xda07,
0xed3b, 0x9dde, 0xfb4a, 0x9c01, 0x80c4, 0x76b5, 0xd91c, 0x9606, 0xf4fb,
0x4937, 0x6130, 0xd6b5, 0x7569, 0x1212, 0xff9e, 0x666f, 0x4f18, 0x319c,
0xbe5f, 0x70be, 0x3b36, 0xa911, 0x68a8, 0xc753, 0xecfb, 0x333a, 0xd6d2,
0xa1a2, 0x3eed, 0x7e75, 0xdcfd, 0x97cc, 0x4cce, 0xdc69, 0x9836, 0x9689,
0xcea4, 0x2885, 0xebe7, 0xc7c3, 0x5f0f, 0x89ce, 0x5a22, 0x9b83, 0x419a,
0x568a, 0x2225, 0x8e75, 0x4db2, 0x7d54, 0x1c20, 0x39ab, 0xb5a7, 0x4a14,
0xf4ec, 0x16bc, 0x113c, 0x1dbb, 0xc9ad, 0xcbf5, 0x46b9, 0xd4c8, 0x6839,
0x25dd, 0xc58b, 0xe835, 0xe8b3, 0x0b48, 0x276c, 0xc724, 0x4c1a, 0x5fb9,
0x218c, 0xa885, 0x9c8f, 0x7ab4, 0xbbe1, 0x5a2e, 0xc248, 0x86b0, 0xd582,
0x7681, 0x64ca, 0xffe3, 0x1b37, 0x83c0, 0x7249, 0xaffa, 0x9c4d, 0x3338,
0x677e, 0x7dcf, 0x76c7, 0x42cf, 0xb736, 0xf788, 0xd794, 0x7407, 0xd452,
0x2944, 0x2ce8, 0xa667, 0xda40, 0x349a, 0xbd8a, 0xcf27, 0x1e88, 0x2569,
0xbcb1, 0x25dc, 0x8079, 0xf6c7, 0x108f, 0x767c, 0x3a4e, 0x6b22, 0x4168,
0x20ea, 0x59d7, 0x7af4, 0x7643, 0xc8f8, 0x4ff4, 0x6d5c, 0xe8b5, 0xe3c0,
0xe184, 0x62b7, 0x3977, 0xfae2, 0x2580, 0x35ae, 0xdb91, 0xd70e, 0x5c50,
0x5a2e, 0x052d, 0x7e33, 0xf88d, 0xe853, 0xf05c, 0x424e, 0xd7ed, 0xb008,
0x1eb0, 0x7096, 0x1abc, 0x1665, 0x843f, 0x26d0, 0x75cc, 0x22f3, 0x50ce,
0xdce4, 0x26dc, 0x21e2, 0x6d94, 0x1b4a, 0x0d81, 0x9e85, 0x2635, 0xd088,
0x651a, 0x8256, 0x30c2, 0xdf0b, 0x3e92, 0xec55, 0xa585, 0x4495, 0x6968,
0x2daf, 0xc282, 0x9e57, 0xc49d, 0x87b9, 0x24ac, 0xdd8a, 0x6562, 0x2b25,
0xf917, 0x9db1, 0xf178, 0xb0ba, 0x1411, 0x59c6, 0x5b14, 0xcac9, 0x055f,
0x98d6, 0x8838, 0x7b03, 0xe2df, 0xf422, 0xc0cb, 0x9646, 0x2f1b, 0x57b6,
0x72bd, 0x7703, 0x2765, 0x18eb, 0x6d02, 0xbd64, 0x370c, 0x6965, 0x5025,
0xb673, 0x91b1, 0x050c, 0xe7b9, 0x495b, 0xc01c, 0x4ac7, 0x9ed6, 0x5857,
0xe5b3, 0xebbe, 0x0aaf, 0xc92b, 0x68fc, 0xb77d, 0xf79f, 0xd19c, 0x83c2,
0xb8ee, 0x5236, 0x7106, 0x979e, 0x1256, 0x6e85, 0xb4b9, 0x7592, 0xdc80,
0x4ac2, 0x00f2, 0xf6f9, 0x1298, 0xf5a0, 0x6f5c, 0x9442, 0x9907, 0x6495,
0x32e1, 0x6a1e, 0xdc5b, 0x4dde, 0xf49e, 0xf073, 0x696f, 0x1b56, 0xbf78,
0x7c67, 0xc88c, 0xaf31, 0xc524, 0xa7b3, 0x527e, 0x7a2e, 0x4a8f, 0x673e,
0x35b4, 0x22bc, 0x7c30, 0x3dc8, 0x1ed9, 0x032b, 0xf3e7, 0x2811, 0x198e,
0xc0db, 0x310c, 0x8600, 0x48e4, 0xaa1a, 0x82ba, 0x86ec, 0x7b35, 0x72c2,
0x653f, 0x4776, 0x690f, 0xfb53, 0xf589, 0x2dc7, 0x3f5b, 0x88cc, 0x26fc,
0xb1c5, 0xe91b, 0xe259, 0xf7ee, 0x21b6, 0x36d3, 0x30bc, 0x46bc, 0x56d2,
0x523f, 0x746e, 0xac75, 0x26b6, 0x85aa, 0x7981, 0x8e87, 0xf36d, 0x49d7,
0x9d0e, 0x1a9a, 0x4e74, 0x8c34, 0xd257, 0xe877, 0xb711, 0xd37b, 0x7957,
0xff9c, 0x35f8, 0xbbb6, 0x7266, 0xf75b, 0x4f3e, 0xebb8, 0xe0e8, 0xed52,
0xd4bd, 0x7461, 0xd07f, 0x039e, 0x06a6, 0xc1ab, 0x19f2, 0x9e8c, 0x57f9,
0x0fe6, 0x1fcc, 0x60d9, 0x1ae0, 0xd676, 0x5f7b, 0x9317, 0x1be6, 0xceed,
0x302f, 0x305a, 0xa169, 0xc2d1, 0x8b49, 0x168c, 0x1a4d, 0x1a32, 0xb5ea,
0x05c3, 0x086e, 0xdb46, 0xd4e7, 0x2db9, 0x7d7b, 0x1827, 0x6713, 0x7cd2,
0xf89f, 0x691b, 0x826c, 0xe03a, 0x148e, 0xade3, 0x0702, 0x8c4c, 0x7342,
0x6615, 0x84a7, 0xc0bc, 0x43f5, 0xaa1a, 0x2fe1, 0x4746, 0x8e1b, 0x525f,
0x7027, 0x3863, 0x37cc, 0x866f, 0xe22f, 0x5fa8, 0xf6f9, 0x77ac, 0x5eee,
0x6867, 0xc6b0, 0x88f0, 0x4787, 0x2af5, 0xec18, 0xb537, 0xb7f4, 0x4d5d,
0x40e1, 0x2f6e, 0x9abc, 0xb12e, 0x634f, 0x8ce1, 0xbd2a, 0x1d25, 0x77dc,
0x485a, 0x7ec3, 0x321b, 0xff4f, 0x1e7a, 0x05fe, 0x4b50, 0x0403, 0x0014,
0x0000, 0x0008, 0x0000, 0x0021, 0xb259, 0x682a, 0x05d1, 0x0000, 0x3963,
0x0000, 0x000f, 0x0000, 0x6f77, 0x6472, 0x732f, 0x7974, 0x656c, 0x2e73,
0x6d78, 0xad6c, 0x5d9b, 0xdb53, 0x1438, 0xdf40, 0x6677, 0x83ff, 0xefc7,
0x5f34, 0x2124, 0x434c, 0x4287, 0x9859, 0x2ca1, 0x6125, 0x59f6, 0x95b1,
0x8358, 0x792d, 0xa525, 0x7f81, 0x295f, 0x63b6, 0x2070, 0x17be, 0xa9e9,
0x2db1, 0x73dd, 0x6ba5, 0x991f, 0xfc8e, 0xdbf5, 0x9673, 0xbf06, 0x54a9,
0xf04c, 0xd869, 0xd2fb, 0x030d, 0x23ca, 0x3311, 0x9abe, 0x8f86, 0xabf3,
0x93a3, 0x5030, 0xf09a, 0xa498, 0xd382, 0xf869, 0x5542, 0xedf8, 0xefec,
0xbebf, 0x4e6e, 0x7e95, 0xa949, 0x4c0a, 0xae00, 0xe54e, 0x4c34, 0xceb4,
0x3b4f, 0x151d, 0x3425, 0xea23, 0xc88b, 0x3729, 0x96d7, 0x6642, 0x9b44,
0xb943, 0x88ea, 0x92e5, 0xf445, 0x4452, 0x8ceb, 0xdd72, 0x77e9, 0xa3bb,
0xa48e, 0xd129, 0xae06, 0x9612, 0xb0ab, 0xb68c, 0x4481, 0x08db, 0xe719,
0x4452, 0x2954, 0x6d93, 0x1696, 0x32f1, 0x78c2, 0x6678, 0x8bd2, 0x7445,
0x9749, 0x9d64, 0x656a, 0xe50f, 0x2cbd, 0xcb0f, 0xeda3, 0x573f, 0x6b82,
0x6c15, 0x894e, 0x188a, 0x869b, 0x9673, 0x1199, 0xd1dd, 0xf04d, 0x3220,
0x43c2, 0x8573, 0xa512, 0x15cf, 0x7323, 0x8793, 0x7f19, 0xb8c6, 0xd790,
0x5ce7, 0x7b31, 0x3131, 0xde3f, 0x16ef, 0xfda9, 0x1dd3, 0x4c8b, 0x5f09,
0xeb99, 0x49bf, 0x0d3a, 0xfae5, 0xe1e8, 0x35f1, 0x1a64, 0x7e52, 0x38f4,
0xa7b3, 0x2c16, 0x9136, 0x3c89, 0x9d9a, 0x8edb, 0x329d, 0x4ee7, 0x2473,
0xeef9, 0xb6c8, 0x1bda, 0x99b6, 0x335c, 0xb3d5, 0x54a2, 0x2ae6, 0xde5d,
0xe88a, 0xc689, 0x6d33, 0x4c2e, 0x6ec3, 0x9c58, 0xbc7c, 0x97b9, 0x484c,
0x5fa6, 0xe1a6, 0x5264, 0x9c9e, 0x8cd1, 0xb35d, 0xa638, 0xcef6, 0x1aa8,
0x84f2, 0xf4c5, 0x84bf, 0x47f2, 0xe345, 0xfcfa, 0xabaf, 0x656d, 0x88ca,
0x5891, 0xf373, 0x3fbb, 0x871a, 0x24db, 0xfc54, 0x39e3, 0xb9a2, 0xb3ad,
0xcab9, 0x9d89, 0x3bc9, 0x21db, 0xadb5, 0x8ed5, 0x7653, 0xb35f, 0x9b2a,
0xc4ea, 0xaa1b, 0xd93d, 0x30f9, 0x426e, 0xbd89, 0x837b, 0x6b5e, 0xc9e8,
0xe87e, 0xd5b2, 0xd5ff, 0x7a68, 0x5000, 0x2f7f, 0x3a2e, 0xc0c4, 0xc43d,
0x7bb1, 0xa188, 0x887b, 0x7b91, 0xb188, 0x887b, 0xf713, 0x9310, 0x87cf,
0x22d0, 0x7a0a, 0xeecd, 0x4983, 0x8f4b, 0xba3e, 0x00c7, 0xe3dd, 0xdd18,
0x8863, 0x31ee, 0xf742, 0xa318, 0x9c7b, 0x7ba0, 0x504c, 0x223d, 0x3db2,
0xebde, 0x0433, 0x03df, 0xa673, 0xda53, 0xa02a, 0xd75e, 0x40cd, 0xe8a5,
0x7b83, 0xc922, 0x924a, 0x093c, 0x7aec, 0x96f6, 0x3872, 0x6cc2, 0xd0bd,
0x54b0, 0x6e7b, 0xcea9, 0x14b4, 0xd57c, 0xe98a, 0xddf7, 0x3f30, 0x3cb2,
0x8a21, 0x76a9, 0xe390, 0xcfd4, 0x22c9, 0xc1a5, 0x923f, 0xadc5, 0xe1a8,
0xbb04, 0xdd84, 0x24a7, 0x89a2, 0x6348, 0x832a, 0x7d39, 0xd8d6, 0x77fe,
0x9822, 0x24e5, 0x8062, 0x7709, 0xeb2c, 0x5b2d, 0x3a25, 0x2598, 0x8624,
0x46c0, 0xc5e8, 0x88bc, 0xcb7f, 0x6e94, 0xde0f, 0x5cfb, 0x5070, 0x470d,
0x6c7d, 0x9ff0, 0x6634, 0xcceb, 0x0d4c, 0x6df4, 0x3464, 0x4470, 0xdbf4,
0xc711, 0x449f, 0x02d8, 0x8640, 0x7430, 0x0f89, 0x7fc8, 0xc9f4, 0xb6f8,
0x90c6, 0xc7fc, 0xf12e, 0xf901, 0xb89f, 0x1fc4, 0xc7b4, 0x9b47, 0x92e6,
0x27c8, 0xe3d8, 0x4635, 0xbb3f, 0x2217, 0x7215, 0x4eb9, 0x7ac1, 0xa318,
0xe09f, 0x010a, 0x021c, 0x21fa, 0xe2ae, 0x24c3, 0x4631, 0xc13f, 0xf46f,
0x9c19, 0x1147, 0xa0e5, 0x0ce7, 0x8b5d, 0xa3da, 0x0a08, 0x1cba, 0x50b5,
0x1411, 0x5174, 0x669a, 0xb045, 0x05d0, 0x2a6a, 0xc116, 0x7372, 0x022d,
0x9684, 0x03ee, 0xcdfd, 0xffec, 0x60f7, 0xd9fb, 0xeacc, 0xcd77, 0xc4d6,
0xc706, 0xef6e, 0xbf16, 0x42d6, 0xbfb7, 0xf698, 0xff1d, 0xbf8a, 0xe6e1,
0x483f, 0x0d14, 0xb460, 0xe381, 0xe36b, 0x1aab, 0x6ea3, 0xb726, 0x0f85,
0x7201, 0x015b, 0x2011, 0xa5b7, 0x0110, 0xfcfa, 0x089a, 0xb887, 0x8e2f,
0x1608, 0xcb5a, 0x0b15, 0x283b, 0x99b4, 0x102b, 0x0972, 0xb4f0, 0x026e,
0xbfde, 0x65d0, 0xd7aa, 0x044d, 0x5d05, 0x7aa0, 0x44dd, 0xd050, 0x69d5,
0x9bae, 0x1608, 0x40ba, 0x75cd, 0xc113, 0xb3f2, 0x026e, 0xe840, 0xf375,
0x0815, 0x2235, 0xf23f, 0x8006, 0xc8fc, 0x001b, 0x23f2, 0x006f, 0x5dc8,
0xedde, 0x7f10, 0x06f2, 0xd0b0, 0xa86e, 0xd858, 0xa141, 0x50f5, 0x9081,
0xf21e, 0x6f24, 0x1fc0, 0xe8b7, 0xd532, 0x46f2, 0xd050, 0xaa05, 0x8de5,
0xa0a0, 0xd3ab, 0x3794, 0x8582, 0x502e, 0xde53, 0x9608, 0x791f, 0x4003,
0xe47e, 0x000d, 0x91f9, 0x0037, 0x47e4, 0x00de, 0x1f90, 0x0379, 0xee40,
0x6ef2, 0xf887, 0x3793, 0x8580, 0x4376, 0xc2c5, 0x0a0e, 0x87ad, 0x840a,
0x90f4, 0x7927, 0xb71f, 0x7c82, 0x1bc8, 0x4140, 0xa817, 0x3796, 0x8282,
0x4eae, 0xde53, 0x1608, 0x40ba, 0x794d, 0x5823, 0xe47e, 0x000d, 0x91f9,
0x0037, 0x47e4, 0x00de, 0x1f90, 0x0379, 0x7e40, 0x0de4, 0xb900, 0xbbcb,
0xe21d, 0xde4f, 0x1600, 0x0dda, 0x0b15, 0x283b, 0x1eb4, 0x102a, 0x43d2,
0xe49e, 0x6c3d, 0xf905, 0x3790, 0x8280, 0x502e, 0x6f2d, 0x0504, 0x9d5d,
0xbca6, 0x2c11, 0x8174, 0xf29a, 0xb046, 0xc8fc, 0x001b, 0x23f2, 0x006f,
0x8fc8, 0x01bc, 0x3f20, 0x06f2, 0xfc80, 0x1bc8, 0x7200, 0x7797, 0xc43b,
0xbc9f, 0x2c01, 0x1bb4, 0x162a, 0x5076, 0x3d68, 0x2054, 0x87a4, 0xc93c,
0xd47b, 0xf20a, 0x6f21, 0x0500, 0xa05d, 0xde5a, 0x0a08, 0x3aba, 0x794d,
0x5823, 0x02e8, 0xe535, 0x608d, 0x91f9, 0x0037, 0x47e4, 0x00de, 0x1f90,
0x0379, 0x7e40, 0x0de4, 0xf900, 0x3791, 0xe400, 0xef2e, 0x8876, 0x793f,
0x5803, 0x3768, 0x2c54, 0xa0ec, 0x7ad0, 0x40a8, 0x0f48, 0xe5e1, 0xf76d,
0x9ad9, 0xa2fd, 0xede0, 0x3da9, 0xbb4f, 0xc01a, 0xbec0, 0x46e3, 0x72d0,
0x0f80, 0x4974, 0xf9a5, 0x0880, 0x93b0, 0x11c2, 0x8c58, 0x4510, 0xdc74,
0xfc5b, 0x885d, 0x00a7, 0xb1b6, 0x307b, 0x4470, 0x45b1, 0xc4ca, 0x9b76,
0xcbcd, 0xec5e, 0xa1f1, 0xc96d, 0x5eff, 0xd704, 0x27c5, 0x7b0c, 0xdefd,
0x82f9, 0xf3a1, 0x03f6, 0xb3a1, 0xabea, 0xd32e, 0xbf50, 0x26e4, 0xfe5e,
0xb77a, 0x5c4f, 0x376c, 0x6edf, 0x2e1a, 0xde1b, 0xbbc4, 0x790f, 0xe74c,
0x126d, 0xc7c5, 0xd54d, 0x22e9, 0xf357, 0x5979, 0x9d5c, 0x76ef, 0xbe2f,
0x87f7, 0x93e7, 0xbf2d, 0xb30c, 0x8e0f, 0x4312, 0x348e, 0x0795, 0x97c0,
0xe9c5, 0x8edd, 0xbb24, 0xbdf9, 0xc691, 0x7b47, 0x2de4, 0xf5fc, 0x14f4,
0x77ad, 0xa945, 0x6b8b, 0x9b0e, 0x3c85, 0xb798, 0xfbb6, 0x0fc2, 0x3ce4,
0xd7b7, 0xce0f, 0xb058, 0xf26d, 0x8251, 0x0993, 0xc32c, 0xa55d, 0xbfb7,
0x22f5, 0x97bd, 0x8fe5, 0x6e1b, 0xb14b, 0xb7b1, 0x2ee3, 0xf8eb, 0x8499,
0xc355, 0x9a0b, 0x3fa6, 0xd149, 0xe45a, 0x371f, 0xe94d, 0x1752, 0x7b57,
0x93dd, 0xae77, 0x842f, 0x22d6, 0xb8fb, 0x34bf, 0x802f, 0x0207, 0xde74,
0xd326, 0x0729, 0x6871, 0xf9ee, 0x5b3a, 0x6950, 0xfd6e, 0x3783, 0x5dab,
0xde53, 0xfa99, 0x5aed, 0x3ae3, 0x55eb, 0xf56e, 0x752f, 0x07f6, 0x4b50,
0x0403, 0x000a, 0x0000, 0x0000, 0x7879, 0x3d69, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x000b, 0x0000, 0x6f77, 0x6472, 0x742f, 0x6568,
0x656d, 0x502f, 0x034b, 0x1404, 0x0000, 0x0800, 0x0000, 0x2100, 0x9600,
0xadb5, 0xb0e2, 0x0005, 0x5000, 0x001b, 0x1500, 0x0000, 0x7700, 0x726f,
0x2f64, 0x6874, 0x6d65, 0x2f65, 0x6874, 0x6d65, 0x3165, 0x782e, 0x6c6d,
0x59ed, 0x8fcd, 0x46d3, 0xbf14, 0xea57, 0x30ff, 0x1df2, 0x2f9c, 0x2c87,
0x8b22, 0xd936, 0x5a04, 0x56be, 0x81bb, 0xe38a, 0x3d8b, 0x8789, 0x7b1d,
0x99ac, 0x2ec9, 0x55b9, 0xac70, 0xa954, 0xad2a, 0x287a, 0x6f52, 0x543d,
0x916d, 0xea40, 0xfe85, 0xdb35, 0xb552, 0xe254, 0xe85f, 0x9db3, 0x76c4,
0x813c, 0xbb2c, 0x2a08, 0x21c8, 0x8f99, 0xfbdf, 0x799e, 0x66f3, 0xe172,
0xdde2, 0x9380, 0x2a03, 0x1315, 0xdb61, 0x9eaa, 0x58ad, 0x8684, 0xf0ae,
0x3858, 0x5b6e, 0x0737, 0x33fd, 0x8b2d, 0x0d28, 0x07a1, 0x845c, 0x6db4,
0xa94d, 0x2eb2, 0x7e6e, 0xd1fc, 0x3805, 0x7daf, 0x501a, 0xf482, 0x3aa1,
0x6d0f, 0xd7cb, 0x3a3a, 0xdb6f, 0xc5ca, 0x5061, 0x4567, 0x4344, 0x1b9c,
0x1909, 0xc680, 0x1cae, 0x9edb, 0x4384, 0x1be4, 0xbb70, 0xa956, 0xed34,
0x5800, 0x9168, 0x0210, 0x7b64, 0x3463, 0x2e62, 0x8325, 0xa598, 0x39b5,
0xde67, 0xf8e3, 0x6a15, 0x0f15, 0x5cb8, 0xb9ee, 0x60f1, 0x229e, 0x7ac5,
0xd5fb, 0x47f8, 0x554d, 0x4b97, 0x0072, 0x6dbc, 0x1ca1, 0x1c4f, 0xe80e,
0x6d5d, 0x0e11, 0xe34a, 0xdb44, 0x24aa, 0xcb1f, 0xbcde, 0x2f60, 0xb888,
0x415e, 0xa39b, 0x27eb, 0x849f, 0x466e, 0x9310, 0x12d7, 0x393a, 0x2e1e,
0xab08, 0xc6fd, 0xb9c6, 0x05ed, 0x5aff, 0xbfca, 0xeb8c, 0x7af5, 0x5edd,
0xc135, 0x002d, 0xbae0, 0x6968, 0x84b5, 0xf46d, 0xd55b, 0x8cce, 0x0667,
0x379a, 0xbccb, 0x15bb, 0xd2a7, 0xe028, 0xfcf3, 0x25eb, 0x46fc, 0xd3a7,
0x3671, 0xf80a, 0x867a, 0x946f, 0xadf0, 0xb34a, 0x55b1, 0xe02b, 0x191b,
0x29de, 0xdfeb, 0xead9, 0x9b76, 0xbc05, 0xe193, 0x259b, 0xff7c, 0x46dc,
0xb1b3, 0x67c0, 0x9f20, 0x70b3, 0x097f, 0x469d, 0x1e74, 0x0c99, 0x1232,
0xb2fc, 0xde11, 0x7842, 0xbe6b, 0x3200, 0x9d94, 0x5d5b, 0x7d29, 0x57a8,
0xb5ad, 0xee00, 0xd908, 0x4047, 0x5c12, 0x2cd0, 0x7a24, 0xd11a, 0xb811,
0xeb88, 0x3042, 0x0c94, 0x0050, 0x524e, 0xcdc8, 0x43a4, 0x2aae, 0xcd0c,
0x1165, 0x4ae5, 0xe916, 0xf5b6, 0x0469, 0x95a1, 0xbc83, 0xfa78, 0x8bf3,
0x8fa7, 0xd1c9, 0x27bd, 0xf747, 0x3b7e, 0x7fba, 0xe8ff, 0xafde, 0xaa06,
0x10cb, 0xf38e, 0xcf54, 0xfc7f, 0xdfea, 0x9f87, 0x7f93, 0xff1e, 0xfcf0,
0x37c1, 0xbc66, 0xe3ca, 0xfcff, 0x8be5, 0x7e3f, 0xdaff, 0xd40c, 0xe079,
0x6fb3, 0xfd1f, 0xe4f5, 0xb3d1, 0xbeef, 0xfbfc, 0x07a7, 0xf806, 0x8496,
0x1e61, 0x603e, 0x5501, 0x3ae4, 0x243d, 0x22bb, 0xd080, 0x8024, 0xe50e,
0x28f1, 0x3e06, 0x3cb0, 0x56c5, 0x5638, 0x4210, 0x634c, 0xf740, 0x5fb4,
0x5f40, 0x029f, 0x0307, 0x43ae, 0x1e8b, 0x25bc, 0x0531, 0x8098, 0x2697,
0x0a77, 0xef0a, 0x72f9, 0x99a2, 0x7801, 0x0fc5, 0xc00a, 0x426b, 0x8ef0,
0x4690, 0xae9b, 0xaca0, 0x1782, 0xe126, 0x2cd8, 0x4e5c, 0xb8f2, 0x805d,
0x9303, 0xeeec, 0x7c52, 0x937b, 0xd708, 0x0332, 0xd413, 0x05a7, 0x7735,
0x8638, 0xc61c, 0xa434, 0xc49a, 0x6273, 0x529f, 0xd903, 0xc66d, 0xc158,
0xe63a, 0xa14a, 0x48c4, 0xdb93, 0x748c, 0x1980, 0x325d, 0x4360, 0x266d,
0xccba, 0x8c02, 0x14cb, 0xf1cc, 0x0286, 0x2dd1, 0x11d2, 0xc4dc, 0x9b7e,
0x141e, 0x8091, 0xe45e, 0x9626, 0x1794, 0x78dc, 0x2609, 0x021a, 0xc6a3,
0xf010, 0xf23c, 0x682a, 0xa4df, 0xdee4, 0xba54, 0x8705, 0x2d2b, 0x3a51,
0x82e5, 0x3cf4, 0x94aa, 0xe689, 0x9c86, 0xd416, 0x02bd, 0x999c, 0x7ec3,
0x4f8d, 0x2283, 0x6a52, 0x5fb6, 0xc646, 0x09fa, 0x4791, 0x8b6e, 0xaefd,
0x410f, 0xd464, 0x8599, 0x1e7e, 0x89fb, 0xc7da, 0x0a25, 0x4764, 0xa368,
0x2212, 0x43bf, 0x3ed2, 0x01c6, 0x95c2, 0xbee1, 0xa8c5, 0xde3e, 0xbede,
0xc6c9, 0x79be, 0xc481, 0x1333, 0xe499, 0xa5ed, 0x1c0c, 0xf0b0, 0xe965,
0x3398, 0xc7cc, 0x9da7, 0x318e, 0x3e01, 0xfefb, 0xffe1, 0x1128, 0xe16f,
0xc499, 0x48d7, 0x09bf, 0x8d6e, 0xdba4, 0xd215, 0xef63, 0xce7e, 0x86dd,
0xb849, 0x4343, 0x43ff, 0xfdca, 0x7290, 0xcbdf, 0x9b94, 0xe7ec, 0x2413,
0x2cda, 0xdab7, 0x8729, 0x895c, 0xac1c, 0x90ac, 0x8c47, 0x3df3, 0xe53d,
0xaaf4, 0xb24a, 0x42b2, 0xbda5, 0x0e3e, 0x9d26, 0x6884, 0x9051, 0x3e47,
0x1336, 0x4b71, 0xb1b8, 0xa484, 0xa44d, 0x9fd0, 0xed31, 0xf9ef, 0xa110,
0xaa98, 0x4c95, 0x642a, 0x369d, 0x2448, 0x5e14, 0xac03, 0xbc55, 0x0993,
0x153c, 0x3a74, 0xa4e6, 0xc017, 0x0d04, 0x9afa, 0xd2f0, 0x7ae1, 0x3176,
0xb1cc, 0x5ec1, 0x222c, 0xa82f, 0x0c8e, 0x16d6, 0x3f56, 0x3277, 0xd561,
0xe54a, 0xd218, 0x8eaa, 0x9a59, 0x52f3, 0x7669, 0x9bce, 0x1bb8, 0xee08,
0x6421, 0xacd5, 0xa2a5, 0xc571, 0xa700, 0x8e1e, 0x0c24, 0xb092, 0x99bc,
0x2910, 0x3c1f, 0x8b3a, 0xd551, 0x4868, 0xbeb5, 0xdba6, 0xaf5a, 0x5af6,
0xda4e, 0xfd46, 0xd264, 0x09d6, 0x5e52, 0x635c, 0x3885, 0x14e7, 0x54a2,
0x4529, 0x2ec9, 0x476f, 0x161e, 0xe47b, 0xb510, 0x6a72, 0x458e, 0x885c,
0xd6da, 0x8b08, 0x6c28, 0x1106, 0x53f2, 0x0271, 0x3e02, 0x87c6, 0x5721,
0x6b4b, 0xcdbd, 0x6cbc, 0x63b0, 0xb836, 0xc2b2, 0x25e0, 0x9111, 0x7a54,
0x941b, 0x529f, 0x5325, 0x77f3, 0x3093, 0xbfd3, 0xa0e6, 0x4f5b, 0x00cb,
0x75fb, 0xa8b5, 0xaab7, 0x516f, 0x7b0b, 0xb439, 0x3474, 0xaea2, 0x315e,
0x7592, 0x7367, 0xa262, 0xdca9, 0xbdf3, 0x3243, 0x13e4, 0x0bb9, 0x77a8,
0x5d23, 0x1e5d, 0x1a53, 0x3c5d, 0xe0ef, 0x187b, 0x3b7a, 0x2de9, 0xfced,
0x558a, 0x9f7e, 0x76c9, 0xf007, 0x87c8, 0x4e59, 0xcd6a, 0xbf63, 0xc780,
0x4ced, 0xec07, 0xd415, 0x0bb3, 0x9fba, 0x94d8, 0x29fa, 0xe29a, 0xbfbc,
0xc4a6, 0x172b, 0xd6cb, 0x97ba, 0xa5dc, 0x0cb0, 0x4090, 0x1922, 0x25ab,
0xf6a4, 0x6605, 0xc8a1, 0x6e67, 0x625f, 0x90e1, 0x42c8, 0xf0bd, 0x154d,
0x51a7, 0x7c47, 0x4e4c, 0x257e, 0x983d, 0xade7, 0x8f39, 0xc934, 0x7d8d,
0xcbbd, 0x44c6, 0xcc32, 0xda74, 0x9497, 0xe8ee, 0x9d99, 0x60af, 0xad56,
0xe765, 0xc66b, 0x3b08, 0x7505, 0x9455, 0x0efe, 0x01e9, 0x83e5, 0xf778,
0xd136, 0xe47e, 0x27e1, 0x64d9, 0x9f46, 0xcae2, 0xb341, 0xbb4d, 0x386b,
0xbfee, 0x95c3, 0xa34f, 0x3af2, 0x41e5, 0xa826, 0xeaf1, 0x2e63, 0x2c27,
0x4a5d, 0x47cb, 0xc6c1, 0x54c9, 0xe638, 0x5b51, 0x5b33, 0x735c, 0x3ed6,
0x236a, 0x7cbc, 0xf890, 0x130b, 0x9337, 0xcf2e, 0xdbea, 0xd881, 0xe8c5,
0x4593, 0x4945, 0x2170, 0x699e, 0xb6cd, 0x62df, 0x8870, 0xb73a, 0xc616,
0xfca5, 0x6cde, 0x9519, 0xa085, 0xc275, 0xf74a, 0xce98, 0xafae, 0x7670,
0xed65, 0xf3ea, 0xce78, 0x0c76, 0x76be, 0xee5e, 0xbb6a, 0x45bc, 0xdced,
0x2645, 0x95ee, 0x75ff, 0xc312, 0x283b, 0x1b7b, 0x4a2f, 0xae13, 0xfa55,
0x7490, 0xaf17, 0xdd9a, 0xffd9, 0x3105, 0x3b1f, 0xdd23, 0x0ffc, 0x4b50,
0x0403, 0x0014, 0x0000, 0x0008, 0x0000, 0x0021, 0xd84a, 0x928a, 0x00b4,
0x0000, 0x0104, 0x0000, 0x0014, 0x0000, 0x6f77, 0x6472, 0x772f, 0x6265,
0x6553, 0x7474, 0x6e69, 0x7367, 0x782e, 0x6c6d, 0xce8d, 0x6ac1, 0x30c3,
0xc60c, 0x7bf1, 0xef61, 0x7410, 0x9d5f, 0x30f5, 0x484a, 0x2852, 0x2fa3,
0xf5d0, 0x5c01, 0x6947, 0xb10c, 0x2464, 0xde6d, 0xf4f6, 0x6c35, 0xdd97,
0x147a, 0xf89f, 0xeff1, 0x5f0f, 0x6d69, 0x513e, 0x3234, 0xf00d, 0x6db2,
0x41a1, 0x3c0a, 0xba45, 0x700d, 0x3f79, 0xef3d, 0x51a1, 0x34f3, 0x95f9,
0x0709, 0x46f8, 0xc385, 0xb4f8, 0x4be9, 0xf057, 0x467a, 0xfab3, 0x4da9,
0x4855, 0x193b, 0x3160, 0x9dcb, 0x1a73, 0x4c16, 0xb75e, 0x919c, 0x36ea,
0x24b3, 0xf56f, 0x9b94, 0x79e3, 0x018e, 0x38df, 0x247c, 0x7324, 0xb6bb,
0x757d, 0xab82, 0x5ab7, 0x4ba0, 0x0acc, 0x5a7f, 0x4479, 0x2c2b, 0x1653,
0xa80e, 0x435a, 0xfad2, 0x25eb, 0x091f, 0xdac6, 0xd9c8, 0x8a62, 0x783f,
0x3962, 0x170a, 0x7145, 0xef63, 0xb5fe, 0x778f, 0x4b50, 0x0403, 0x000a,
0x0000, 0x0000, 0x7879, 0x3d69, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x000b, 0x0000, 0x6f77, 0x6472, 0x5f2f, 0x6572, 0x736c, 0x502f,
0x034b, 0x1404, 0x0000, 0x0800, 0x0000, 0x2100, 0xd600, 0xb364, 0xed51,
0x0000, 0x3100, 0x0003, 0x1c00, 0x0000, 0x7700, 0x726f, 0x2f64, 0x725f,
0x6c65, 0x2f73, 0x6f64, 0x7563, 0x656d, 0x746e, 0x782e, 0x6c6d, 0x722e,
0x6c65, 0xad73, 0xcb92, 0xc34e, 0x1030, 0xf745, 0xfc48, 0x3583, 0xe27b,
0x3ca4, 0xaa84, 0xdd3a, 0x4aa0, 0x42dd, 0x00f8, 0x99d7, 0x843c, 0x5b63,
0x299e, 0xbf90, 0x2ac7, 0x5202, 0x5551, 0x645d, 0xd739, 0x739a, 0x48cf,
0xad5e, 0x073f, 0xde2b, 0x5231, 0x9def, 0x2282, 0x41cb, 0x33a0, 0xeebe,
0xab5d, 0xb5e0, 0xdcda, 0x823c, 0xd620, 0xd6ae, 0x3bd6, 0x3054, 0xc122,
0xbcba, 0x5abe, 0xa33d, 0x9cd5, 0xa896, 0x03eb, 0x4489, 0xa471, 0x63a0,
0x4b0e, 0xc929, 0x3874, 0xca68, 0x407c, 0x5e97, 0x1f1a, 0xcd07, 0x8c69,
0x0cad, 0xbcda, 0x16e9, 0x22e5, 0x1fcf, 0x9c64, 0xa032, 0x623c, 0x6d8a,
0x20ad, 0xeb6e, 0x105b, 0x18d5, 0x12f0, 0x6fb6, 0xde9a, 0x93e0, 0xfb37,
0x1d01, 0xa89f, 0x1f90, 0x7bb8, 0xe641, 0x1c74, 0xac25, 0x2d8e, 0x82b2,
0x9849, 0x2225, 0xd3c8, 0x8b22, 0x4539, 0x9fe8, 0x5d05, 0x50a0, 0xaacc,
0xa3c0, 0x89c5, 0x61c0, 0x5b3e, 0x3f7f, 0x3d67, 0x5da7, 0x6bfc, 0x8c3f,
0x61df, 0xce71, 0x6ee1, 0x874e, 0x3bc6, 0xf4ae, 0x4ece, 0x7e3c, 0x1fa3,
0x7909, 0xd1f4, 0x2fcb, 0x4b50, 0x0403, 0x0014, 0x0000, 0x0008, 0x0000,
0x0021, 0xfcdd, 0x3795, 0x0154, 0x0000, 0x0520, 0x0000, 0x0013, 0x0000,
0x435b, 0x6e6f, 0x6574, 0x746e, 0x545f, 0x7079, 0x7365, 0x2e5d, 0x6d78,
0xb56c, 0x4b54, 0x024f, 0x1031, 0x9bbe, 0x1ff8, 0xbd36, 0xb612, 0xc1e0,
0xc318, 0xc1c2, 0x51c7, 0xc449, 0x501f, 0x59da, 0xec68, 0x4db6, 0x7867,
0x7bfd, 0x5967, 0xa0e0, 0x5584, 0xcb91, 0xdd26, 0x5ef9, 0x9d33, 0x3074,
0x575a, 0x5b2e, 0x4242, 0x7c1b, 0xfa21, 0x4f79, 0xe064, 0x3075, 0xcfd6,
0xf10a, 0x793e, 0xdeee, 0x0c89, 0x7949, 0x5ca3, 0x50f0, 0x0d88, 0x18a0,
0xaf0d, 0x06af, 0x4d93, 0xcc04, 0xed98, 0x10b1, 0xa273, 0x2f78, 0xea25,
0x5439, 0xf30a, 0xc110, 0xa573, 0xa90c, 0xc452, 0x34c7, 0x5193, 0x0fe9,
0x0335, 0xd379, 0xddeb, 0x1d4a, 0x813c, 0x2ea7, 0x1ad5, 0x3862, 0x8478,
0x2d52, 0x651c, 0x6b4f, 0xddfe, 0x4924, 0x50e0, 0x0f64, 0x900d, 0xd8bd,
0xc55a, 0xace8, 0xc456, 0xb975, 0xe6f4, 0x4b8b, 0xe777, 0x3390, 0x8b73,
0xb9c1, 0xd88d, 0x8061, 0x4790, 0xb81d, 0xc272, 0xc760, 0xe57b, 0x24d1,
0x206b, 0xab1b, 0x2f44, 0x62aa, 0x5c94, 0x6485, 0x09a4, 0x517a, 0x3331,
0xe067, 0x72ef, 0xb286, 0x1ab4, 0xfc0e, 0x2d5a, 0xa0a6, 0x9101, 0x5e67,
0xfcb9, 0xa950, 0xf594, 0xb69d, 0x481c, 0x071b, 0xfff8, 0x1a29, 0x53dd,
0xccf6, 0xa71d, 0x5110, 0xd3b2, 0xfed9, 0xdf50, 0x018b, 0x8dd3, 0x8189,
0x2c89, 0x7b60, 0x40eb, 0x61c4, 0xd12f, 0xa37c, 0x1edc, 0x7881, 0xa1df,
0xf6f9, 0x8ecf, 0x95b1, 0xb569, 0x032c, 0xabab, 0x83a9, 0xfdb3, 0xb5be,
0x97bd, 0x0f6e, 0x82b1, 0xdbe9, 0xa6c5, 0x8b5f, 0xe0ff, 0x0e02, 0xa7fb,
0xfa43, 0x30c3, 0xcff6, 0xcd45, 0xb23e, 0x7275, 0xbefb, 0x3f0d, 0x5001,
0x034b, 0x0a04, 0x0000, 0x0000, 0x7900, 0x6978, 0x003d, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0600, 0x0000, 0x5f00, 0x6572, 0x736c, 0x502f,
0x034b, 0x1404, 0x0000, 0x0800, 0x0000, 0x2100, 0x1e00, 0x1a91, 0xe9b7,
0x0000, 0x4e00, 0x0002, 0x0b00, 0x0000, 0x5f00, 0x6572, 0x736c, 0x2e2f,
0x6572, 0x736c, 0x928d, 0x6ac1, 0x30c3, 0x400c, 0x83ef, 0x83fd, 0xbdd1,
0xda51, 0x18c1, 0x4ea3, 0x632f, 0xdbd0, 0xdd18, 0x0807, 0x495b, 0x134c,
0xd8db, 0xd76a, 0xfdfe, 0xd8cc, 0x02d8, 0x975d, 0x65a3, 0xe9e9, 0x6849,
0x39bd, 0x838d, 0x723a, 0x2eca, 0x0d78, 0xaacb, 0xc506, 0x04de, 0x7ceb,
0xe1a7, 0xf76d, 0x78bc, 0x9500, 0xbc85, 0x21a5, 0xd678, 0xe670, 0x9b0c,
0xf6e6, 0xfd66, 0x03ca, 0x2949, 0xbdca, 0x598b, 0x8a15, 0x1acf, 0x917a,
0x88f8, 0x4d98, 0x23cf, 0x2ae5, 0xf644, 0xa7e5, 0x690d, 0x2924, 0xd4cf,
0x2461, 0xa7b3, 0x718e, 0xd755, 0x98f7, 0x337e, 0x99a0, 0xd530, 0x6ad6,
0x5b48, 0x077b, 0x776a, 0x3c8e, 0x1d87, 0xd6da, 0x7e19, 0xe60a, 0xb230,
0x0b97, 0x902d, 0xc24f, 0xb2de, 0xc45d, 0xea54, 0x3893, 0x05ce, 0xa94f,
0xd163, 0x8360, 0x2979, 0x8ce1, 0x6314, 0xd055, 0x9780, 0x568d, 0x8df3,
0x9efe, 0x4716, 0xb216, 0x8424, 0x2426, 0xeabe, 0x99f3, 0x4d71, 0x3968,
0xe85f, 0x15ff, 0x334d, 0x6c7e, 0x43de, 0x68b2, 0xc2bf, 0x36df, 0xb938,
0xe682, 0x5003, 0x014b, 0x1402, 0x0a00, 0x0000, 0x0000, 0xc100, 0x697c,
0x003d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0900, 0x0000, 0x0000,
0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 0x0000, 0x6400, 0x636f, 0x7250,
0x706f, 0x2f73, 0x4b50, 0x0201, 0x0014, 0x0014, 0x0000, 0x0008, 0x0000,
0x0021, 0xba8c, 0xf18b, 0x0165, 0x0000, 0x02c5, 0x0000, 0x0010, 0x0000,
0x0000, 0x0000, 0x0000, 0x0080, 0x0000, 0x0027, 0x0000, 0x6f64, 0x5063,
0x6f72, 0x7370, 0x612f, 0x7070, 0x782e, 0x6c6d, 0x4b50, 0x0201, 0x0014,
0x0014, 0x0000, 0x0008, 0x7cc1, 0x3d69, 0xc57d, 0x2286, 0x0123, 0x0000,
0x0233, 0x0000, 0x0011, 0x0000, 0x0000, 0x0000, 0x0000, 0x0020, 0x0000,
0x01ba, 0x0000, 0x6f64, 0x5063, 0x6f72, 0x7370, 0x632f, 0x726f, 0x2e65,
0x6d78, 0x506c, 0x014b, 0x1402, 0x0a00, 0x0000, 0x0000, 0x7900, 0x6978,
0x003d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0500, 0x0000, 0x0000,
0x0000, 0x0000, 0x1000, 0x0000, 0x0c00, 0x0003, 0x7700, 0x726f, 0x2f64,
0x4b50, 0x0201, 0x0014, 0x0014, 0x0000, 0x0008, 0x0000, 0x0021, 0xdcb0,
0xf731, 0x01a2, 0x0000, 0x03d8, 0x0000, 0x0011, 0x0000, 0x0000, 0x0000,
0x0000, 0x0080, 0x0000, 0x032f, 0x0000, 0x6f77, 0x6472, 0x642f, 0x636f,
0x6d75, 0x6e65, 0x2e74, 0x6d78, 0x506c, 0x014b, 0x1402, 0x1400, 0x0000,
0x0800, 0x0000, 0x2100, 0x2600, 0xbcf9, 0x6d97, 0x0001, 0x0700, 0x0004,
0x1200, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x0000, 0x0000, 0x0005,
0x7700, 0x726f, 0x2f64, 0x6f66, 0x746e, 0x6154, 0x6c62, 0x2e65, 0x6d78,
0x506c, 0x014b, 0x1402, 0x1400, 0x0000, 0x0800, 0x0000, 0x2100, 0xe900,
0x8df8, 0x4ec2, 0x0003, 0x3b00, 0x0009, 0x1100, 0x0000, 0x0000, 0x0000,
0x0000, 0x8000, 0x0000, 0x9d00, 0x0006, 0x7700, 0x726f, 0x2f64, 0x6573,
0x7474, 0x6e69, 0x7367, 0x782e, 0x6c6d, 0x4b50, 0x0201, 0x0014, 0x0014,
0x0000, 0x0008, 0x0000, 0x0021, 0xb259, 0x682a, 0x05d1, 0x0000, 0x3963,
0x0000, 0x000f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0000, 0x0a1a,
0x0000, 0x6f77, 0x6472, 0x732f, 0x7974, 0x656c, 0x2e73, 0x6d78, 0x506c,
0x014b, 0x1402, 0x0a00, 0x0000, 0x0000, 0x7900, 0x6978, 0x003d, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0b00, 0x0000, 0x0000, 0x0000, 0x0000,
0x1000, 0x0000, 0x1800, 0x0010, 0x7700, 0x726f, 0x2f64, 0x6874, 0x6d65,
0x2f65, 0x4b50, 0x0201, 0x0014, 0x0014, 0x0000, 0x0008, 0x0000, 0x0021,
0xb596, 0xe2ad, 0x05b0, 0x0000, 0x1b50, 0x0000, 0x0015, 0x0000, 0x0000,
0x0000, 0x0000, 0x0080, 0x0000, 0x1041, 0x0000, 0x6f77, 0x6472, 0x742f,
0x6568, 0x656d, 0x742f, 0x6568, 0x656d, 0x2e31, 0x6d78, 0x506c, 0x014b,
0x1402, 0x1400, 0x0000, 0x0800, 0x0000, 0x2100, 0x4a00, 0x8ad8, 0xb492,
0x0000, 0x0400, 0x0001, 0x1400, 0x0000, 0x0000, 0x0000, 0x0000, 0x8000,
0x0000, 0x2400, 0x0016, 0x7700, 0x726f, 0x2f64, 0x6577, 0x5362, 0x7465,
0x6974, 0x676e, 0x2e73, 0x6d78, 0x506c, 0x014b, 0x1402, 0x0a00, 0x0000,
0x0000, 0x7900, 0x6978, 0x003d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
0x0b00, 0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0a00, 0x0017,
0x7700, 0x726f, 0x2f64, 0x725f, 0x6c65, 0x2f73, 0x4b50, 0x0201, 0x0014,
0x0014, 0x0000, 0x0008, 0x0000, 0x0021, 0x64d6, 0x51b3, 0x00ed, 0x0000,
0x0331, 0x0000, 0x001c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080, 0x0000,
0x1733, 0x0000, 0x6f77, 0x6472, 0x5f2f, 0x6572, 0x736c, 0x642f, 0x636f,
0x6d75, 0x6e65, 0x2e74, 0x6d78, 0x2e6c, 0x6572, 0x736c, 0x4b50, 0x0201,
0x0014, 0x0014, 0x0000, 0x0008, 0x0000, 0x0021, 0xfcdd, 0x3795, 0x0154,
0x0000, 0x0520, 0x0000, 0x0013, 0x0000, 0x0000, 0x0000, 0x0000, 0x0080,
0x0000, 0x185a, 0x0000, 0x435b, 0x6e6f, 0x6574, 0x746e, 0x545f, 0x7079,
0x7365, 0x2e5d, 0x6d78, 0x506c, 0x014b, 0x1402, 0x0a00, 0x0000, 0x0000,
0x7900, 0x6978, 0x003d, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0600,
0x0000, 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0xdf00, 0x0019, 0x5f00,
0x6572, 0x736c, 0x502f, 0x014b, 0x1402, 0x1400, 0x0000, 0x0800, 0x0000,
0x2100, 0x1e00, 0x1a91, 0xe9b7, 0x0000, 0x4e00, 0x0002, 0x0b00, 0x0000,
0x0000, 0x0000, 0x0000, 0x8000, 0x0000, 0x0300, 0x001a, 0x5f00, 0x6572,
0x736c, 0x2e2f, 0x6572, 0x736c, 0x4b50, 0x0605, 0x0000, 0x0000, 0x0010,
0x0010, 0x03d1, 0x0000, 0x1b15, 0x0000, 0x0000
END
#endif // Russian resources
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"#include ""winres.h""\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION INTVER
PRODUCTVERSION INTVER
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x2L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", COMPANY_NAME
VALUE "FileDescription", FILE_DESCRIPTION_ACTIVEX
VALUE "FileVersion", STRVER
VALUE "InternalName", COMPONENT_FILE_NAME_DLL
VALUE "LegalCopyright", LEGAL_COPYRIGHT
VALUE "OriginalFilename", COMPONENT_FILE_NAME_DLL
VALUE "ProductName", FILE_DESCRIPTION_ACTIVEX
VALUE "ProductVersion", STRVER
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 0x04B0
END
END
/////////////////////////////////////////////////////////////////////////////
//
// REGISTRY
//
IDR_ASCOFFICEDOCXRENDERER REGISTRY "ASCOfficeDocxRenderer.rgs"
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE
BEGIN
IDS_PROJNAME "ASCOfficeDocxRenderer"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
HKCR
{
NoRemove AppID
{
'%APPID%' = s 'ASCOfficeDocxRenderer'
'ASCOfficeDocxRenderer.DLL'
{
val AppID = s '%APPID%'
}
}
}
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="ASCOfficeDocxRenderer"
ProjectGUID="{B9D1A580-70B2-4CF0-A8D4-152A8E84015E}"
RootNamespace="ASCOfficeDocxRenderer"
Keyword="AtlProj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficeDocxRenderer.tlb"
HeaderFileName="ASCOfficeDocxRenderer.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeDocxRenderer_i.c"
ProxyFileName="ASCOfficeDocxRenderer_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\DocxFormat;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\Common"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)/ASCOfficeDocxRenderer.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\ASCOfficeUtils\ZLIB\zlib123dll\static32;..\..\Common\ASCDocxFormat\Lib\Debug"
IgnoreDefaultLibraryNames="LIBC.LIB"
MergedIDLBaseFileName="_ASCOfficeDocxRenderer.idl"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(OutDir)/ASCOfficeDocxRenderer.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficeDocxRenderer.tlb"
HeaderFileName="ASCOfficeDocxRenderer.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeDocxRenderer_i.c"
ProxyFileName="ASCOfficeDocxRenderer_p.c"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\DocxFormat;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\Common"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
OutputFile="$(OutDir)/ASCOfficeDocxRenderer.dll"
LinkIncremental="1"
MergedIDLBaseFileName="_ASCOfficeDocxRenderer.idl"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/ASCOfficeDocxRenderer.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ASCDocxRenderer.cpp"
>
</File>
<File
RelativePath=".\ASCOfficeDocxRenderer.cpp"
>
</File>
<File
RelativePath=".\Document.cpp"
>
</File>
<File
RelativePath=".\FontManager.cpp"
>
</File>
<File
RelativePath=".\Page.cpp"
>
</File>
<File
RelativePath=".\PageString.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\TransformationMatrix.cpp"
>
</File>
<File
RelativePath=".\VMLGraphicsPath.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\ASCDocxRenderer.h"
>
</File>
<File
RelativePath=".\ASCOfficeCriticalSection.h"
>
</File>
<File
RelativePath="..\..\ASCImageStudio3\ASCGraphics\Interfaces\ASCRenderer.h"
>
</File>
<File
RelativePath=".\Document.h"
>
</File>
<File
RelativePath=".\FontManager.h"
>
</File>
<File
RelativePath="E:\Subversion\Common\OfficeRendererTemplate.h"
>
</File>
<File
RelativePath=".\OOXUtils.h"
>
</File>
<File
RelativePath=".\Page.h"
>
</File>
<File
RelativePath=".\PageString.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\Singleton.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\TransformationMatrix.h"
>
</File>
<File
RelativePath=".\Utils.h"
>
</File>
<File
RelativePath=".\version.h"
>
</File>
<File
RelativePath=".\VMLGraphicsPath.h"
>
</File>
<File
RelativePath="..\..\..\..\..\Common\xmlutils.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\ASCOfficeDocxRenderer.rc"
>
</File>
<File
RelativePath=".\ASCOfficeDocxRenderer.rgs"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="ASCOfficeDocxRenderer"
ProjectGUID="{BAB70A60-2DA0-4149-B8FC-99D7007E9BDB}"
RootNamespace="ASCOfficeDocxRenderer"
Keyword="AtlProj"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficeDocxRenderer.tlb"
HeaderFileName="ASCOfficeDocxRenderer.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeDocxRenderer_i.c"
ProxyFileName="ASCOfficeDocxRenderer_p.c"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\DocxFormat;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\Common"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="Msimg32.lib"
OutputFile="$(OutDir)/ASCOfficeDocxRenderer.dll"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\ASCOfficeUtils\ZLIB\zlib123dll\static32;..\..\Common\ASCDocxFormat\Lib\Debug"
IgnoreDefaultLibraryNames="LIBC.LIB"
MergedIDLBaseFileName="_ASCOfficeDocxRenderer.idl"
GenerateDebugInformation="true"
SubSystem="2"
ImportLibrary="$(OutDir)/ASCOfficeDocxRenderer.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
UseOfATL="1"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="..\..\..\..\Redist\VersionControl.exe $(ProjectDir)version.h"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="false"
TargetEnvironment="1"
GenerateStublessProxies="true"
TypeLibraryName="$(IntDir)/ASCOfficeDocxRenderer.tlb"
HeaderFileName="ASCOfficeDocxRenderer.h"
DLLDataFileName=""
InterfaceIdentifierFileName="ASCOfficeDocxRenderer_i.c"
ProxyFileName="ASCOfficeDocxRenderer_p.c"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\..\Common\ASCDocxFormat\Source\DocxFormat;..\..\Common\ASCDocxFormat\Source\XML;..\..\Common\ASCDocxFormat\Source\Utility;..\..\Common\ASCDocxFormat\Source\Common"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="2"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1049"
AdditionalIncludeDirectories="$(IntDir)"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
IgnoreImportLibrary="true"
AdditionalDependencies="Msimg32.lib"
OutputFile="..\..\Redist\$(ProjectName).dll"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\ASCOfficeUtils\ZLIB\zlib123dll\static32;..\..\Common\ASCDocxFormat\Lib\Release"
IgnoreDefaultLibraryNames="LIBC.LIB"
MergedIDLBaseFileName="_ASCOfficeDocxRenderer.idl"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/ASCOfficeDocxRenderer.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Performing registration"
CommandLine="regsvr32 /s /c &quot;$(TargetPath)&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ASCDocxRenderer.cpp"
>
</File>
<File
RelativePath=".\ASCOfficeDocxRenderer.cpp"
>
</File>
<File
RelativePath=".\Document.cpp"
>
</File>
<File
RelativePath=".\FontManager.cpp"
>
</File>
<File
RelativePath=".\Page.cpp"
>
</File>
<File
RelativePath=".\PageString.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\TransformationMatrix.cpp"
>
</File>
<File
RelativePath=".\VMLGraphicsPath.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\ASCDocxRenderer.h"
>
</File>
<File
RelativePath=".\ASCOfficeCriticalSection.h"
>
</File>
<File
RelativePath="..\..\ASCImageStudio3\ASCGraphics\Interfaces\ASCRenderer.h"
>
</File>
<File
RelativePath=".\Document.h"
>
</File>
<File
RelativePath=".\FontManager.h"
>
</File>
<File
RelativePath="E:\Subversion\Common\OfficeRendererTemplate.h"
>
</File>
<File
RelativePath=".\OOXUtils.h"
>
</File>
<File
RelativePath=".\Page.h"
>
</File>
<File
RelativePath=".\PageString.h"
>
</File>
<File
RelativePath=".\Resource.h"
>
</File>
<File
RelativePath=".\Singleton.h"
>
</File>
<File
RelativePath=".\stdafx.h"
>
</File>
<File
RelativePath=".\TransformationMatrix.h"
>
</File>
<File
RelativePath=".\Utils.h"
>
</File>
<File
RelativePath=".\version.h"
>
</File>
<File
RelativePath=".\VMLGraphicsPath.h"
>
</File>
<File
RelativePath="..\..\..\..\..\Common\xmlutils.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
<File
RelativePath=".\ASCOfficeDocxRenderer.rc"
>
</File>
<File
RelativePath=".\ASCOfficeDocxRenderer.rgs"
>
</File>
</Filter>
<File
RelativePath=".\ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
#include "stdafx.h"
#include "Document.h"
namespace DocxRenderer
{
Document::Document( TextAssociationType _textAssociationType ):
width(0), height(0), pageCount(0), textAssociationType(_textAssociationType)
{
this->currentPage = Page( &this->ooxFolder, &this->fontManager, this->textAssociationType );
}
/*========================================================================================================*/
Document::Document( const std::wstring& _ooxDir, TextAssociationType _textAssociationType ):
width(0), height(0), pageCount(0), textAssociationType(_textAssociationType)
{
this->ooxFolder.createFromTemplate( _ooxDir );
this->currentPage = Page( &this->ooxFolder, &this->fontManager, this->textAssociationType );
}
/*========================================================================================================*/
void Document::CreateFromTemplate( const std::wstring& _ooxDir )
{
this->ooxFolder.createFromTemplate( _ooxDir );
}
/*========================================================================================================*/
void Document::SetDestinationPath( const std::wstring& _destinationPath )
{
this->destinationPath = _destinationPath;
}
/*========================================================================================================*/
std::wstring Document::GetDestinationPath() const
{
return this->destinationPath;
}
/*========================================================================================================*/
void Document::AddPage()
{
if ( this->pageCount > 1 )
{
if ( !this->ooxFolder.find<OOX::Document>().Items->empty() )
{
if ( this->ooxFolder.find<OOX::Document>().Items->front().is<OOX::Logic::Paragraph>() )
{
OOX::Logic::Paragraph& paragraph = this->ooxFolder.find<OOX::Document>().Items->front().as<OOX::Logic::Paragraph>();
paragraph.Property.init();
paragraph.Property->Spacing.init();
paragraph.Property->Spacing->Line = 1;
paragraph.Property->Spacing->LineRule = "exact";
}
}
this->previousPage.Build();
std::vector<OOX::Logic::Paragraph> pageParagraphs = this->previousPage.GetParagraphs();
for ( std::vector<OOX::Logic::Paragraph>::const_iterator pageParagraphsIter = pageParagraphs.begin(); pageParagraphsIter != pageParagraphs.end(); ++pageParagraphsIter )
{
this->ooxFolder.find<OOX::Document>().Items->push_back( *pageParagraphsIter );
}
this->ooxFolder.Commit( this->destinationPath );
}
if ( this->pageCount > 0 )
{
if ( ( this->currentPage.GetWidth() == 0 ) && ( this->currentPage.GetHeight() == 0 ) )
{
this->currentPage.SetWidth( this->width );
this->currentPage.SetHeight( this->height );
}
this->previousPage = this->currentPage;
this->currentPage = Page( &this->ooxFolder, &this->fontManager, this->textAssociationType );
}
this->pageCount++;
}
/*========================================================================================================*/
void Document::SetWidth( double _dWidth )
{
if ( this->pageCount > 1 )
{
if ( this->previousPage.GetWidth() == 0 )
{
this->previousPage.SetWidth( this->width );
}
}
else
{
this->currentPage.SetWidth( 0 );
}
this->width = _dWidth;
this->currentPage.SetGraphicsWidth( this->width );
}
/*========================================================================================================*/
double Document::GetWidth() const
{
return this->width;
}
/*========================================================================================================*/
void Document::SetHeight( double _dHeight )
{
if ( this->pageCount > 1 )
{
if ( this->previousPage.GetHeight() == 0 )
{
this->previousPage.SetHeight( this->height );
}
}
else
{
this->currentPage.SetHeight( 0 );
}
this->height = _dHeight;
this->currentPage.SetGraphicsHeight( this->height );
}
/*========================================================================================================*/
double Document::GetHeight() const
{
return this->height;
}
/*========================================================================================================*/
void Document::SetTextAssociationType( TextAssociationType _textAssociationType )
{
this->textAssociationType = _textAssociationType;
this->previousPage.SetTextAssociationType( this->textAssociationType );
this->currentPage.SetTextAssociationType( this->textAssociationType );
}
/*========================================================================================================*/
TextAssociationType Document::GetTextAssociationType() const
{
return this->textAssociationType;
}
/*========================================================================================================*/
void Document::BeginCommand( unsigned long _lType )
{
this->currentPage.BeginCommand( _lType );
}
/*========================================================================================================*/
void Document::EndCommand( unsigned long _lType )
{
this->currentPage.EndCommand( _lType );
}
/*========================================================================================================*/
void Document::AddText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset, const std::wstring& _gidText )
{
this->currentPage.AddText( _text, _dX, _dY, _dWidth, _dHeight, _dBaseLineOffset, this->width, this->height, _gidText );
}
/*========================================================================================================*/
void Document::AddImage( const std::wstring& _fileName, double _dX, double _dY, double _dWidth, double _dHeight )
{
this->currentPage.AddImage( _fileName, _dX, _dY, _dWidth, _dHeight );
}
/*========================================================================================================*/
void Document::PathMoveTo( double _dX, double _dY )
{
this->currentPage.PathMoveTo( _dX, _dY );
}
/*========================================================================================================*/
void Document::PathLineTo( double _dX, double _dY )
{
this->currentPage.PathLineTo( _dX, _dY );
}
/*========================================================================================================*/
void Document::PathLinesTo( const std::vector<double>& _points )
{
this->currentPage.PathLinesTo( _points );
}
/*========================================================================================================*/
void Document::PathCurveTo( double _x1, double _y1, double _x2, double _y2, double _x3, double _y3 )
{
this->currentPage.PathCurveTo( _x1, _y1, _x2, _y2, _x3, _y3 );
}
/*========================================================================================================*/
void Document::PathCurvesTo( const std::vector<double>& _points )
{
this->currentPage.PathCurvesTo( _points );
}
/*========================================================================================================*/
void Document::PathArcTo( double _x, double _y, double _width, double _height, double _startAngle, double _sweepAngle )
{
this->currentPage.PathArcTo( _x, _y, _width, _height, _startAngle, _sweepAngle );
}
/*========================================================================================================*/
void Document::PathClose()
{
this->currentPage.PathClose();
}
/*========================================================================================================*/
void Document::PathEnd()
{
this->currentPage.PathEnd();
}
/*========================================================================================================*/
void Document::DrawPath( long _nType, unsigned int _resize )
{
this->currentPage.DrawPath( _nType, _resize );
}
/*========================================================================================================*/
void Document::PathStart()
{
//!!!TODO!!!
this->currentPage.PathStart();
}
/*========================================================================================================*/
void Document::PathGetCurrentPoint( double* _dX, double* _dY )
{
this->currentPage.PathGetCurrentPoint( _dX, _dY );
}
/*========================================================================================================*/
void Document::GetCommandParams( double* _dAngle, double* _dLeft, double* _dTop, double* _dWidth, double* _dHeight, unsigned long* _lFlags )
{
this->currentPage.GetCommandParams( _dAngle, _dLeft, _dTop, _dWidth, _dHeight, _lFlags );
}
/*========================================================================================================*/
void Document::SetCommandParams( double _dAngle, double _dLeft, double _dTop, double _dWidth, double _dHeight, unsigned long _lFlags )
{
this->currentPage.SetCommandParams( _dAngle, _dLeft, _dTop, _dWidth, _dHeight, _lFlags );
}
/*========================================================================================================*/
void Document::SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF )
{
this->currentPage.SetTransform( _dA, _dB, _dC, _dD, _dE, _dF );
}
/*========================================================================================================*/
void Document::SetTransform( const TransformationMatrix& _matrix )
{
this->currentPage.SetTransform( _matrix );
}
/*========================================================================================================*/
void Document::GetTransform( double* _pdA, double* _pdB, double* _pdC, double* _pdD, double* _pdE, double* _pdF )
{
this->currentPage.GetTransform( _pdA, _pdB, _pdC, _pdD, _pdE, _pdF );
}
/*========================================================================================================*/
void Document::ResetTransform()
{
this->currentPage.ResetTransform();
}
/*========================================================================================================*/
long Document::GetClipMode()
{
//!!!TODO!!!
return this->currentPage.GetClipMode();
}
/*========================================================================================================*/
void Document::SetClipMode( long _lMode )
{
//!!!TODO!!!
this->currentPage.SetClipMode( _lMode );
}
/*========================================================================================================*/
void Document::PathText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset )
{
//!!!TODO!!!
this->currentPage.PathText( _text, _dX, _dY, _dWidth, _dHeight, _dBaseLineOffset );
}
/*========================================================================================================*/
void Document::SetPenColor( const std::string& _penColor )
{
this->currentPage.SetPenColor( _penColor );
}
/*========================================================================================================*/
void Document::SetPenSize( double _penSize )
{
this->currentPage.SetPenSize( _penSize );
}
/*========================================================================================================*/
void Document::SetFontColor( const std::string& _fontColor )
{
this->currentPage.SetFontColor( _fontColor );
}
/*========================================================================================================*/
void Document::SetBrushColor( const std::string& _brushColor )
{
this->currentPage.SetBrushColor( _brushColor );
}
/*========================================================================================================*/
void Document::SetFontName( const std::string& _fontName )
{
if ( this->currentFont.name.empty() )
{
this->currentFont.name = _fontName;
}
if ( !this->IsFontPresent( this->currentFont.name ) )
{
if ( this->currentFont.characteristics.IsDefault() )
{
OOX::FontTable& fontTable = this->ooxFolder.find<OOX::Document>().find<OOX::FontTable>();
OOX::FontTable::Font font;
font.Name = this->currentFont.name;
fontTable.Fonts->push_back( font );
}
else
{
this->SetFont( this->currentFont );
}
}
this->currentPage.SetFontName( this->currentFont.name );
}
/*========================================================================================================*/
void Document::SetFont( const Font& _font )
{
if ( !this->IsFontPresent( _font.name ) )
{
OOX::FontTable& fontTable = this->ooxFolder.find<OOX::Document>().find<OOX::FontTable>();
OOX::FontTable::Font font;
font.Name = _font.name;
font.Panose1 = ToString( _font.characteristics.panose );
font.Pitch = ( ( _font.characteristics.isFixedWidth ) ? ( "fixed" ) : ( "variable" ) );
font.Usb0 = ToString( _font.characteristics.signature[0] );
font.Usb1 = ToString( _font.characteristics.signature[1] );
font.Usb2 = ToString( _font.characteristics.signature[2] );
font.Usb3 = ToString( _font.characteristics.signature[3] );
font.Csb0 = ToString( _font.characteristics.signature[4] );
font.Csb1 = ToString( _font.characteristics.signature[5] );
fontTable.Fonts->push_back( font );
}
this->currentPage.SetFontName( _font.name );
}
/*========================================================================================================*/
void Document::SetFontSize( double _fontSize )
{
this->currentPage.SetFontSize( _fontSize );
}
/*========================================================================================================*/
void Document::LoadFontFromFile( const std::wstring& _fileName, double _fontSize, double _xDPI, double _yDPI, long _faceIndex )
{
std::wstring styleName;
this->fontManager.LoadFontFromFile( _fileName, _fontSize, _xDPI, _yDPI, _faceIndex );
FontCharacteristics fontCharacteristics;
fontCharacteristics.panose = this->fontManager.GetPANOSE();
fontCharacteristics.isFixedWidth = this->fontManager.IsFixedWidth();
fontCharacteristics.signature = this->fontManager.GetSignature();
this->currentFont.characteristics = fontCharacteristics;
if ( fontCharacteristics.IsDefault() )
{
this->currentFont.name = ToString( this->fontManager.GetFamilyName() );
}
else
{
this->currentFont.name = ToString( this->FindFont( fontCharacteristics ) );
if ( !this->currentFont.name.empty() )
{
this->currentPage.SetFontName( this->currentFont.name );
}
else
{
this->currentFont.name = ToString( this->fontManager.GetFamilyName() );
}
}
styleName = this->fontManager.GetStyleName();
if ( styleName.empty() )
{
styleName = _T( "Regular" );
}
if ( ( styleName == _T( "Regular" ) ) || ( styleName == _T( "Medium" ) ) )
{
this->SetBold( false );
this->SetItalic( false );
}
else if ( styleName == _T( "Bold" ) )
{
this->SetBold( true );
this->SetItalic( false );
}
else if ( styleName == _T( "Italic" ) )
{
this->SetBold( false );
this->SetItalic( true );
}
else if ( styleName == _T( "Bold Italic" ) )
{
this->SetBold( true );
this->SetItalic( true );
}
}
/*========================================================================================================*/
void Document::SetBold( bool _value )
{
this->currentPage.SetBold( _value );
}
/*========================================================================================================*/
void Document::SetItalic( bool _value )
{
this->currentPage.SetItalic( _value );
}
/*========================================================================================================*/
void Document::SetUnderline( bool _value )
{
this->currentPage.SetUnderline( _value );
}
/*========================================================================================================*/
void Document::SetStrikeout( bool _value )
{
this->currentPage.SetStrikeout( _value );
}
/*========================================================================================================*/
void Document::Save() const
{
if ( !this->ooxFolder.find<OOX::Document>().Items->empty() )
{
if ( this->ooxFolder.find<OOX::Document>().Items->front().is<OOX::Logic::Paragraph>() )
{
OOX::Logic::Paragraph& paragraph = this->ooxFolder.find<OOX::Document>().Items->front().as<OOX::Logic::Paragraph>();
paragraph.Property.init();
paragraph.Property->Spacing.init();
paragraph.Property->Spacing->Line = 1;
paragraph.Property->Spacing->LineRule = "exact";
}
}
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Top = 0;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Right = 0;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Bottom = 0;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Left = 0;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Header = 0;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Footer = 0;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageMargin->Gutter = 0;
UniversalUnit mmValue( UniversalUnit::Mm );
UniversalUnit dxValue( UniversalUnit::Dx );
mmValue = this->width;
dxValue = mmValue;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageSize->Width = dxValue;
mmValue = this->height;
dxValue = mmValue;
this->ooxFolder.find<OOX::Document>().SectorProperty->PageSize->Height = dxValue;
if(this->width <= this->height )
this->ooxFolder.find<OOX::Document>().SectorProperty->PageSize->Orient = "portrait";
else
this->ooxFolder.find<OOX::Document>().SectorProperty->PageSize->Orient = "landscape";
this->previousPage.Build();
std::vector<OOX::Logic::Paragraph> pageParagraphs = this->previousPage.GetParagraphs();
for ( std::vector<OOX::Logic::Paragraph>::const_iterator pageParagraphsIter = pageParagraphs.begin(); pageParagraphsIter != pageParagraphs.end(); ++pageParagraphsIter )
{
this->ooxFolder.find<OOX::Document>().Items->push_back( *pageParagraphsIter );
}
this->currentPage.Build();
pageParagraphs = this->currentPage.GetParagraphs();
for ( std::vector<OOX::Logic::Paragraph>::const_iterator pageParagraphsIter = pageParagraphs.begin(); pageParagraphsIter != pageParagraphs.end(); ++pageParagraphsIter )
{
this->ooxFolder.find<OOX::Document>().Items->push_back( *pageParagraphsIter );
}
this->ooxFolder.Finalize( this->destinationPath );
}
/*========================================================================================================*/
bool Document::IsFontPresent( const std::string& _fontName ) const
{
bool result = false;
OOX::FontTable& fontTable = this->ooxFolder.find<OOX::Document>().find<OOX::FontTable>();
BOOST_FOREACH( const OOX::FontTable::Font& font, *fontTable.Fonts )
{
if ( font.Name == _fontName )
{
result = true;
break;
}
}
return result;
}
/*========================================================================================================*/
std::wstring Document::FindFont( const FontCharacteristics& _fontCharacteristics ) const
{
std::wstring fontName;
OOX::FontTable& fontTable = this->ooxFolder.find<OOX::Document>().find<OOX::FontTable>();
BOOST_FOREACH( const OOX::FontTable::Font& font, *fontTable.Fonts )
{
FontCharacteristics fontCharacteristics;
if ( font.Panose1.is_init() )
{
fontCharacteristics.panose = ToWString( *font.Panose1 );
}
if ( font.Pitch == "fixed" )
{
fontCharacteristics.isFixedWidth = true;
}
else if ( font.Pitch == "variable" )
{
fontCharacteristics.isFixedWidth = false;
}
if ( font.Usb0.is_init() )
{
fontCharacteristics.signature[0] = ToWString( *font.Usb0 );
}
if ( font.Usb1.is_init() )
{
fontCharacteristics.signature[1] = ToWString( *font.Usb1 );
}
if ( font.Usb2.is_init() )
{
fontCharacteristics.signature[2] = ToWString( *font.Usb2 );
}
if ( font.Usb3.is_init() )
{
fontCharacteristics.signature[3] = ToWString( *font.Usb3 );
}
if ( font.Csb0.is_init() )
{
fontCharacteristics.signature[4] = ToWString( *font.Csb0 );
}
if ( font.Csb1.is_init() )
{
fontCharacteristics.signature[5] = ToWString( *font.Csb1 );
}
if ( fontCharacteristics == _fontCharacteristics )
{
fontName = ToWString( *font.Name );
break;
}
}
return fontName;
}
}
\ No newline at end of file
#pragma once
#include "Page.h"
namespace DocxRenderer
{
class Document
{
private:
struct FontCharacteristics
{
std::wstring panose;
bool isFixedWidth;
std::vector<std::wstring> signature;
FontCharacteristics():
panose(_T( "00000000000000000000" )), isFixedWidth(false)
{
this->signature.clear();
this->signature.push_back( _T( "00000000" ) );
this->signature.push_back( _T( "00000000" ) );
this->signature.push_back( _T( "00000000" ) );
this->signature.push_back( _T( "00000000" ) );
this->signature.push_back( _T( "00000000" ) );
this->signature.push_back( _T( "00000000" ) );
}
bool operator == ( const FontCharacteristics& _fontCharacteristics ) const
{
if ( this->panose != _fontCharacteristics.panose )
{
return false;
}
if ( this->isFixedWidth != _fontCharacteristics.isFixedWidth )
{
return false;
}
for ( unsigned int i = 0; i < this->signature.size(); i++ )
{
if ( this->signature[i] != _fontCharacteristics.signature[i] )
{
return false;
}
}
return true;
}
bool IsDefault() const
{
if ( this->panose != _T( "00000000000000000000" ) )
{
return false;
}
for ( unsigned int i = 0; i < this->signature.size(); i++ )
{
if ( this->signature[i] != _T( "00000000" ) )
{
return false;
}
}
if ( this->isFixedWidth )
{
return false;
}
return true;
}
};
struct Font
{
std::string name;
FontCharacteristics characteristics;
};
private:
Page previousPage;
Page currentPage;
mutable Docx::Folder ooxFolder;
FontManager fontManager;
TextAssociationType textAssociationType;
double width;
double height;
unsigned int pageCount;
std::wstring destinationPath;
Font currentFont;
private:
bool IsFontPresent( const std::string& _fontName ) const;
std::wstring FindFont( const FontCharacteristics& _fontCharacteristics ) const;
public:
explicit Document( TextAssociationType _textAssociationType = TextAssociationTypeDefault );
Document( const std::wstring& _ooxDir, TextAssociationType _textAssociationType = TextAssociationTypeDefault );
void CreateFromTemplate( const std::wstring& _ooxDir );
void SetDestinationPath( const std::wstring& _destinationPath );
std::wstring GetDestinationPath() const;
void AddPage();
void SetWidth( double _dWidth );
double GetWidth() const;
void SetHeight( double _dHeight );
double GetHeight() const;
void SetTextAssociationType( TextAssociationType _textAssociationType );
TextAssociationType GetTextAssociationType() const;
void BeginCommand( unsigned long _lType );
void EndCommand( unsigned long _lType );
void AddText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset, const std::wstring& _gidText = _T( "" ) );
void AddImage( const std::wstring& _fileName, double _dX, double _dY, double _dWidth, double _dHeight );
void PathMoveTo( double _dX, double _dY );
void PathLineTo( double _dX, double _dY );
void PathLinesTo( const std::vector<double>& _points );
void PathCurveTo( double _x1, double _y1, double _x2, double _y2, double _x3, double _y3 );
void PathCurvesTo( const std::vector<double>& _points );
void PathArcTo( double _x, double _y, double _width, double _height, double _startAngle, double _sweepAngle );
void PathClose();
void PathEnd();
void DrawPath( long _nType, unsigned int _resize = 1000000 );
void PathStart();
void PathGetCurrentPoint( double* _dX, double* _dY );
void GetCommandParams( double* _dAngle, double* _dLeft, double* _dTop, double* _dWidth, double* _dHeight, unsigned long* _lFlags );
void SetCommandParams( double _dAngle, double _dLeft, double _dTop, double _dWidth, double _dHeight, unsigned long _lFlags );
void SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF );
void SetTransform( const TransformationMatrix& _matrix );
void GetTransform( double* _pdA, double* _pdB, double* _pdC, double* _pdD, double* _pdE, double* _pdF );
void ResetTransform();
long GetClipMode();
void SetClipMode( long _lMode );
void PathText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset );
void SetPenColor( const std::string& _penColor );
void SetPenSize( double _penSize );
void SetFontColor( const std::string& _fontColor );
void SetBrushColor( const std::string& _brushColor );
void SetFontName( const std::string& _fontName );
void SetFont( const Font& _font );
void SetFontSize( double _fontSize );
void LoadFontFromFile( const std::wstring& _fileName, double _fontSize, double _xDPI = 72, double _yDPI = 72, long _faceIndex = 0 );
void SetBold( bool _value );
void SetItalic( bool _value );
void SetUnderline( bool _value );
void SetStrikeout( bool _value );
void Save() const;
};
}
\ No newline at end of file
#include "stdafx.h"
#include "FontManager.h"
namespace DocxRenderer
{
FontManager::FontManager( const std::wstring& _xmlOptions, double _xDPI, double _yDPI ):
xDPI(_xDPI), yDPI(_yDPI)
{
this->pFontManager.CreateInstance( __uuidof(AVSGraphics::CAVSFontManager) );
this->pFontManager->Initialize( _bstr_t( _xmlOptions.c_str() ) );
this->defaultFontName = _T( "Arial" );
this->pFontManager->SetDefaultFont( _bstr_t( this->defaultFontName.c_str() ) );
}
/*========================================================================================================*/
FontManager::~FontManager()
{
this->pFontManager.Release();
}
/*========================================================================================================*/
void FontManager::SetDefaultFont( const std::wstring& _familyName )
{
this->defaultFontName = _familyName;
this->pFontManager->SetDefaultFont( _bstr_t( this->defaultFontName.c_str() ) );
}
/*========================================================================================================*/
std::wstring FontManager::GetDefaultFont() const
{
return this->defaultFontName;
}
/*========================================================================================================*/
void FontManager::SetXDPI( double _xDPI )
{
this->xDPI = _xDPI;
}
/*========================================================================================================*/
double FontManager::GetXDPI() const
{
return this->xDPI;
}
/*========================================================================================================*/
void FontManager::SetYDPI( double _yDPI )
{
this->yDPI = _yDPI;
}
/*========================================================================================================*/
double FontManager::GetYDPI() const
{
return this->yDPI;
}
/*========================================================================================================*/
double FontManager::GetTextWidth( const std::wstring& _text, const std::wstring& _fontName, double _fontSize, long _fontStyle, MeasureType _measureType ) const
{
UniversalUnit ptValue( UniversalUnit::Pt );
UniversalUnit mmValue( UniversalUnit::Mm );
HRESULT res = S_FALSE;
float fBoxX = 0;
float fBoxY = 0;
float fBoxWidth = 0;
float fBoxHeight = 0;
res = this->pFontManager->LoadFontByName( _bstr_t( _fontName.c_str() ), _fontSize, _fontStyle, this->xDPI, this->yDPI );
res = this->pFontManager->LoadStringW( _bstr_t( _text.c_str() ), 0, 0 );
if ( _measureType == MeasureTypeGlyph )
{
res = this->pFontManager->MeasureString( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
else if ( _measureType == MeasureTypePosition )
{
res = this->pFontManager->MeasureString2( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
ptValue = fBoxWidth;
mmValue = ptValue;
return mmValue;
}
/*========================================================================================================*/
double FontManager::GetTextWidth( const std::wstring& _text, MeasureType _measureType, bool _isGidText ) const
{
UniversalUnit ptValue( UniversalUnit::Pt );
UniversalUnit mmValue( UniversalUnit::Mm );
HRESULT res = S_FALSE;
float fBoxX = 0;
float fBoxY = 0;
float fBoxWidth = 0;
float fBoxHeight = 0;
if ( _isGidText )
{
res = this->pFontManager->SetStringGID( 1 );
}
res = this->pFontManager->LoadStringW( _bstr_t( _text.c_str() ), 0, 0 );
if ( _measureType == MeasureTypeGlyph )
{
res = this->pFontManager->MeasureString( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
else if ( _measureType == MeasureTypePosition )
{
res = this->pFontManager->MeasureString2( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
if ( _isGidText )
{
res = this->pFontManager->SetStringGID( 0 );
}
ptValue = fBoxWidth;
mmValue = ptValue;
return mmValue;
}
/*========================================================================================================*/
double FontManager::GetTextHeight( const std::wstring& _text, const std::wstring& _fontName, double _fontSize, long _fontStyle, MeasureType _measureType ) const
{
UniversalUnit ptValue( UniversalUnit::Pt );
UniversalUnit mmValue( UniversalUnit::Mm );
HRESULT res = S_FALSE;
float fBoxX = 0;
float fBoxY = 0;
float fBoxWidth = 0;
float fBoxHeight = 0;
res = this->pFontManager->LoadFontByName( _bstr_t( _fontName.c_str() ), _fontSize, _fontStyle, this->xDPI, this->yDPI );
res = this->pFontManager->LoadStringW( _bstr_t( _text.c_str() ), 0, 0 );
if ( _measureType == MeasureTypeGlyph )
{
res = this->pFontManager->MeasureString( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
else if ( _measureType == MeasureTypePosition )
{
res = this->pFontManager->MeasureString2( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
ptValue = fBoxHeight;
mmValue = ptValue;
return mmValue;
}
/*========================================================================================================*/
double FontManager::GetFontHeight( const std::wstring& _fontName, double _fontSize, long _fontStyle ) const
{
HRESULT res = S_FALSE;
double fontHeight = 0;
UniversalUnit ptValue( UniversalUnit::Pt );
UniversalUnit mmValue( UniversalUnit::Mm );
res = this->pFontManager->LoadFontByName( _bstr_t( _fontName.c_str() ), _fontSize, _fontStyle, this->xDPI, this->yDPI );
if ( SUCCEEDED( res ) )
{
unsigned short lineSpacing = 0;
unsigned short eMHeight = 0;
res = this->pFontManager->GetLineSpacing( &lineSpacing );
res = this->pFontManager->GetEmHeight( &eMHeight );
if ( SUCCEEDED( res ) )
{
ptValue = ( ( lineSpacing * _fontSize ) / eMHeight );
mmValue = ptValue;
fontHeight = mmValue;
}
}
return fontHeight;
}
/*========================================================================================================*/
double FontManager::GetFontHeight( double _fontSize ) const
{
HRESULT res = S_FALSE;
double fontHeight = 0;
UniversalUnit ptValue( UniversalUnit::Pt );
UniversalUnit mmValue( UniversalUnit::Mm );
unsigned short lineSpacing = 0;
unsigned short eMHeight = 0;
res = this->pFontManager->GetLineSpacing( &lineSpacing );
res = this->pFontManager->GetEmHeight( &eMHeight );
if ( SUCCEEDED( res ) )
{
ptValue = ( ( lineSpacing * _fontSize ) / eMHeight );
mmValue = ptValue;
fontHeight = mmValue;
}
return fontHeight;
}
/*========================================================================================================*/
void FontManager::MeasureString( const std::wstring& _text, const std::wstring& _fontName, double _fontSize, long _fontStyle, double _x, double _y, double* _boxX, double* _boxY, double* _boxWidth, double* _boxHeight, MeasureType _measureType ) const
{
if ( ( _boxX != NULL ) && ( _boxY != NULL ) && ( _boxWidth != NULL ) && ( _boxHeight != NULL ) )
{
UniversalUnit ptValue( UniversalUnit::Pt );
UniversalUnit mmValue( UniversalUnit::Mm );
HRESULT res = S_FALSE;
float fBoxX = 0;
float fBoxY = 0;
float fBoxWidth = 0;
float fBoxHeight = 0;
mmValue = _x;
ptValue = mmValue;
_x = ptValue;
mmValue = _y;
ptValue = mmValue;
_y = ptValue;
res = this->pFontManager->LoadFontByName( _bstr_t( _fontName.c_str() ), _fontSize, _fontStyle, this->xDPI, this->yDPI );
res = this->pFontManager->LoadStringW( _bstr_t( _text.c_str() ), _x, _y );
if ( _measureType == MeasureTypeGlyph )
{
res = this->pFontManager->MeasureString( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
else if ( _measureType == MeasureTypePosition )
{
res = this->pFontManager->MeasureString2( &fBoxX, &fBoxY, &fBoxWidth, &fBoxHeight );
}
ptValue = fBoxX;
mmValue = ptValue;
*_boxX = mmValue;
ptValue = fBoxY;
mmValue = ptValue;
*_boxY = mmValue;
ptValue = fBoxWidth;
mmValue = ptValue;
*_boxWidth = mmValue;
ptValue = fBoxHeight;
mmValue = ptValue;
*_boxHeight = mmValue;
}
}
/*========================================================================================================*/
double FontManager::GetSpaceWidthBetweenStrings( const std::wstring& _firstString, const std::wstring& _secondString, const std::wstring& _fontName, double _fontSize, long _fontStyle, MeasureType _measureType ) const
{
const std::wstring stringWithSpace = ( _firstString + _T( " " ) + _secondString );
double stringWithSpaceWidth = this->GetTextWidth( stringWithSpace, _fontName, _fontSize, _fontStyle, _measureType );
double firstStringWidth = this->GetTextWidth( _firstString, _fontName, _fontSize, _fontStyle, _measureType );
double secondStringWidth = this->GetTextWidth( _secondString, _fontName, _fontSize, _fontStyle, _measureType );
return ( stringWithSpaceWidth - firstStringWidth - secondStringWidth );
}
/*========================================================================================================*/
void FontManager::LoadFontFromFile( const std::wstring& _fileName, double _fontSize, double _xDPI, double _yDPI, long _faceIndex )
{
HRESULT res = S_FALSE;
res = this->pFontManager->LoadFontFromFile( _bstr_t( _fileName.c_str() ), _fontSize, _xDPI, _yDPI, _faceIndex );
}
/*========================================================================================================*/
std::wstring FontManager::GetFamilyName() const
{
HRESULT res = S_FALSE;
_bstr_t familyNameBSTR;
std::wstring familyName;
res = this->pFontManager->GetFamilyNameEx( _bstr_t( "<DeletePDFPrefix/>" ), familyNameBSTR.GetAddress() );
if ( familyNameBSTR.length() != 0 )
{
familyName = std::wstring( familyNameBSTR );
}
return familyName;
}
/*========================================================================================================*/
std::wstring FontManager::GetStyleName() const
{
HRESULT res = S_FALSE;
_bstr_t styleNameBSTR;
std::wstring styleName;
res = this->pFontManager->GetStyleName( styleNameBSTR.GetAddress() );
if ( styleNameBSTR.length() != 0 )
{
styleName = std::wstring( styleNameBSTR );
}
return styleName;
}
/*========================================================================================================*/
std::wstring FontManager::GetPANOSE() const
{
HRESULT res = S_FALSE;
SAFEARRAY* panoseSafeArray = NULL;
std::wstring panose;
res = this->pFontManager->GetPanose( &panoseSafeArray );
if ( panoseSafeArray != NULL )
{
LONG lCount = panoseSafeArray->rgsabound[0].cElements;
byte* pData = (byte*)(panoseSafeArray->pvData);
for ( LONG i = 0; i < (LONG)( lCount ); i++ )
{
panose += ToWString( Utils::ToHexString( pData[i] ) );
}
SafeArrayDestroy( panoseSafeArray );
}
return panose;
}
/*========================================================================================================*/
bool FontManager::IsFixedWidth() const
{
HRESULT res = S_FALSE;
long isFixedWidthLong = 0;
res = this->pFontManager->IsFixedWidth( &isFixedWidthLong );
return ( ( isFixedWidthLong != 0 ) ? ( true ) : ( false ) );
}
/*========================================================================================================*/
std::vector<std::wstring> FontManager::GetSignature() const
{
HRESULT res = S_FALSE;
std::vector<std::wstring> signature;
VARIANT_BOOL vbSuccess = VARIANT_FALSE;
for ( unsigned int i = 0; i < 6; i++ )
{
unsigned int value = 0;
for ( unsigned long bit = 0; bit < 32; bit++ )
{
res = this->pFontManager->IsUnicodeRangeAvailable( bit, i, &vbSuccess );
if( VARIANT_TRUE == vbSuccess )
{
value |= ( 1 << bit );
}
}
signature.push_back( ToWString( Utils::ToHexString( value ) ) );
}
return signature;
}
}
\ No newline at end of file
#pragma once
#include "Docx.h"
#include "Singleton.h"
#include "Utils.h"
#import ".\..\..\Redist\ASCGraphics.dll" raw_interfaces_only
namespace DocxRenderer
{
class FontManager
{
public:
enum MeasureType
{
MeasureTypeGlyph = 0,
MeasureTypePosition
};
private:
AVSGraphics::IAVSFontManagerPtr pFontManager;
double xDPI;
double yDPI;
std::wstring defaultFontName;
public:
FontManager( const std::wstring& _xmlOptions = _T( "" ), double _xDPI = 72, double _yDPI = 72 );
~FontManager();
void SetDefaultFont( const std::wstring& _familyName );
std::wstring GetDefaultFont() const;
void SetXDPI( double _xDPI );
double GetXDPI() const;
void SetYDPI( double _yDPI );
double GetYDPI() const;
double GetTextWidth( const std::wstring& _text, const std::wstring& _fontName, double _fontSize, long _fontStyle, MeasureType _measureType = MeasureTypeGlyph ) const;
double GetTextWidth( const std::wstring& _text, MeasureType _measureType = MeasureTypeGlyph, bool _isGidText = false ) const;
double GetTextHeight( const std::wstring& _text, const std::wstring& _fontName, double _fontSize, long _fontStyle, MeasureType _measureType = MeasureTypeGlyph ) const;
double GetFontHeight( const std::wstring& _fontName, double _fontSize, long _fontStyle ) const;
double GetFontHeight( double _fontSize ) const;
void MeasureString( const std::wstring& _text, const std::wstring& _fontName, double _fontSize, long _fontStyle, double _x, double _y, double* _boxX, double* _boxY, double* _boxWidth, double* _boxHeight, MeasureType _measureType = MeasureTypeGlyph ) const;
double GetSpaceWidthBetweenStrings( const std::wstring& _firstString, const std::wstring& _secondString, const std::wstring& _fontName, double _fontSize, long _fontStyle, MeasureType _measureType = MeasureTypeGlyph ) const;
void LoadFontFromFile( const std::wstring& _fileName, double _fontSize, double _xDPI = 0, double _yDPI = 0, long _faceIndex = 0 );
std::wstring GetFamilyName() const;
std::wstring GetStyleName() const;
std::wstring GetPANOSE() const;
bool IsFixedWidth() const;
std::vector<std::wstring> GetSignature() const;
};
class FontManagerSingleton: public Singleton<FontManagerSingleton>, public FontManager
{
protected:
FontManagerSingleton(): FontManager() {};
virtual ~FontManagerSingleton() {};
friend class Singleton<FontManagerSingleton>;
};
}
\ No newline at end of file
#pragma once
#include "Docx.h"
namespace DocxRenderer
{
namespace OOXUtils
{
inline OOX::Logic::TextFrameProperties GetTextFrameProperties( double _x, double _y, double _width = 0 /*auto*/, double _height = 0 /*auto*/ )
{
OOX::Logic::TextFrameProperties textFrameProperty;
textFrameProperty.HAnchor = "page";
textFrameProperty.VAnchor = "page";
UniversalUnit mmValue( UniversalUnit::Mm );
UniversalUnit dxValue( UniversalUnit::Dx );
mmValue = _x;
dxValue = mmValue;
textFrameProperty.X = ( ( dxValue > 0 ) ? ( dxValue ) : ( 1 ) );
mmValue = _y;
dxValue = mmValue;
textFrameProperty.Y = ( ( dxValue > 0 ) ? ( dxValue ) : ( 1 ) );
if ( _width > 0 )
{
mmValue = _width;
dxValue = mmValue;
textFrameProperty.W = dxValue;
}
if ( _height > 0 )
{
mmValue = _height;
dxValue = mmValue;
textFrameProperty.H = dxValue;
}
return textFrameProperty;
}
}
}
\ No newline at end of file
#include "stdafx.h"
#include "Page.h"
namespace DocxRenderer
{
const double Page::STANDART_STRING_HEIGHT_MM = 4.2333333333333334;
const double Page::THE_SAME_STRING_Y_PRECISION_MM = 0.01;
OOX::Logic::RunProperty Page::GetRunProperties() const
{
OOX::Logic::RunProperty runProperty;
if ( !this->fontColor.empty() )
{
runProperty.FontColor = this->fontColor;
}
OOX::Logic::RFonts fonts;
if ( !this->fontName.empty() )
{
fonts.Ascii = fonts.Cs = fonts.HAnsi = this->fontName;
}
else
{
fonts.Ascii = fonts.Cs = fonts.HAnsi = ::ToString( this->fontManager->GetDefaultFont() );
}
runProperty.RFonts = fonts;
if ( this->fontSize != 0 )
{
runProperty.FontSize = ( 2 * this->fontSize );
//!!!TODO: Scaling!!!
if ( *runProperty.FontSize <= 2 )
{
runProperty.FontSize = ( 2 * this->matrix.GetD() );
}
}
if( true == this->bold )
runProperty.Bold = this->bold;
if( true == this->italic )
runProperty.Italic = this->italic;
if( true == this->strikeout )
runProperty.Strike = this->strikeout;
if ( this->underline )
{
runProperty.Under = true;
runProperty.UnderType = "single";
}
//else
//{
// runProperty.Under = false;
// runProperty.UnderType = "none";
//}
return runProperty;
}
/*========================================================================================================*/
PageString* Page::GetPageString( double _y ) const
{
PageString* pageString = NULL;
for ( std::vector<PageString>::iterator iter = this->strings.begin(); iter != this->strings.end(); ++iter )
{
if ( fabs( iter->GetY() - _y ) <= THE_SAME_STRING_Y_PRECISION_MM )
{
pageString = &(*iter);
break;
}
}
return pageString;
}
/*========================================================================================================*/
Page::Page():
hyperlinkMode(false), clipMode(false), width(0), height(0), textAssociationType(TextAssociationTypeDefault), ooxFolder(NULL), fontManager(NULL),
bold(false), italic(false), underline(false), strikeout(false), dAngle(0), dLeft(0), dTop(0), dWidth(0),
dHeight(0), lFlags(0), fontSize(0), penSize(0)
{
this->drawingParagraph.Property.init();
this->drawingParagraph.Property->Spacing.init();
this->drawingParagraph.Property->Spacing->Line = 1;
this->drawingParagraph.Property->Spacing->LineRule = "exact";
}
/*========================================================================================================*/
Page::Page( Docx::Folder* _ooxFolder, FontManager* _fontManager, TextAssociationType _textAssociationType, double _width, double _height ):
hyperlinkMode(false), clipMode(false), width(_width), height(_height), textAssociationType(_textAssociationType), ooxFolder(_ooxFolder), fontManager(_fontManager),
bold(false), italic(false), underline(false), strikeout(false), dAngle(0), dLeft(0), dTop(0), dWidth(0),
dHeight(0), lFlags(0), fontSize(0), penSize(0)
{
this->drawingParagraph.Property.init();
this->drawingParagraph.Property->Spacing.init();
this->drawingParagraph.Property->Spacing->Line = 1;
this->drawingParagraph.Property->Spacing->LineRule = "exact";
}
/*========================================================================================================*/
void Page::SetWidth( double _width )
{
this->width = _width;
}
/*========================================================================================================*/
double Page::GetWidth() const
{
return this->width;
}
/*========================================================================================================*/
void Page::SetGraphicsWidth( double _width )
{
this->vmlGraphicsPath.SetWidth( _width );
}
/*========================================================================================================*/
void Page::SetHeight( double _height )
{
this->height = _height;
this->vmlGraphicsPath.SetHeight( this->height );
}
/*========================================================================================================*/
double Page::GetHeight() const
{
return this->height;
}
/*========================================================================================================*/
void Page::SetGraphicsHeight( double _height )
{
this->vmlGraphicsPath.SetHeight( _height );
}
/*========================================================================================================*/
void Page::SetTextAssociationType( TextAssociationType _textAssociationType )
{
this->textAssociationType = _textAssociationType;
}
/*========================================================================================================*/
TextAssociationType Page::GetTextAssociationType() const
{
return this->textAssociationType;
}
/*========================================================================================================*/
void Page::BeginCommand( unsigned long _lType )
{
//!!!TODO!!!
switch ( _lType )
{
case c_nHyperlinkType:
{
this->hyperlinkMode = true;
}
break;
case c_nClipType:
{
this->clipMode = true;
}
break;
case c_nResetClipType:
{
this->clipMode = false;
}
break;
}
}
/*========================================================================================================*/
void Page::EndCommand( unsigned long _lType )
{
//!!!TODO!!!
switch ( _lType )
{
case c_nHyperlinkType:
{
this->hyperlinkMode = false;
}
break;
case c_nClipType:
{
this->clipMode = false;
this->PathEnd();
}
break;
case c_nResetClipType:
{
this->clipMode = false;
}
break;
}
}
/*========================================================================================================*/
void Page::SetOOXFolder( Docx::Folder* _ooxFolder )
{
this->ooxFolder = _ooxFolder;
}
/*========================================================================================================*/
void Page::SetFontManager( FontManager* _fontManager )
{
this->fontManager = _fontManager;
}
/*========================================================================================================*/
void Page::AddText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset, double _xRestriction, double _yRestriction, const std::wstring& _gidText )
{
if ( !this->hyperlinkMode )
{
double x = _dX;
double y = _dY;
this->matrix.AffineTransform( x, y );
//!!!TODO: Sometimes x and/or y comes too large from some PDF-files or less than 0.!!!
if ( ( x >= 0 ) && ( y >= 0 ) && ( ( ( _xRestriction == 0 ) || ( ( _xRestriction != 0 ) && ( x < _xRestriction ) ) ) ||
( ( _yRestriction == 0 ) || ( ( _yRestriction != 0 ) && ( y < _yRestriction ) ) ) ) )
{
OOX::Logic::RunProperty runProperty = this->GetRunProperties();
switch ( this->textAssociationType )
{
case TextAssociationTypeDefault:
{
this->strings.push_back( PageString( _text, _gidText, runProperty, x, y, this->fontManager ) );
}
break;
case TextAssociationTypeLine:
{
PageString* pageString = this->GetPageString( y );
if ( pageString != NULL )
{
pageString->AddText( _text, runProperty, x, _gidText );
}
else
{
this->strings.push_back( PageString( _text, _gidText, runProperty, x, y, this->fontManager ) );
}
}
break;
case TextAssociationTypeBlock:
{
PageString* pageString = this->GetPageString( y );
if ( pageString != NULL )
{
pageString->AddText( _text, runProperty, x, _gidText );
}
else
{
this->strings.push_back( PageString( _text, _gidText, runProperty, x, y, this->fontManager ) );
}
}
break;
case TextAssociationTypeNoFrames:
{
PageString* pageString = this->GetPageString( y );
if ( pageString != NULL )
{
pageString->AddText( _text, runProperty, x, _gidText );
}
else
{
this->strings.push_back( PageString( _text, _gidText, runProperty, x, y, this->fontManager ) );
}
}
break;
}
}
}
}
/*========================================================================================================*/
void Page::AddImage( const std::wstring& _fileName, double _dX, double _dY, double _dWidth, double _dHeight )
{
UniversalUnit mmX( UniversalUnit::Mm );
UniversalUnit mmY( UniversalUnit::Mm );
UniversalUnit mmWidth( UniversalUnit::Mm );
UniversalUnit mmHeight( UniversalUnit::Mm );
double x = _dX;
double y = _dY;
double width = _dWidth;
double height = _dHeight;
this->matrix.AffineTransform( x, y );
this->matrix.LinearTransform( width, height );
mmX = x;
mmY = y;
mmWidth = std::abs( width );
mmHeight = std::abs( height );
OOX::Image* docxImage = new OOX::Image( _fileName );
if ( docxImage != NULL )
{
const OOX::RId rId = this->ooxFolder->find<OOX::Document>().add( boost::shared_ptr<OOX::File>( docxImage ) );
OOX::Logic::Drawing* drawing = new OOX::Logic::Drawing( rId, _fileName, mmX.value( UniversalUnit::Multi ), "page", mmY.value( UniversalUnit::Multi ), "page", mmWidth.value( UniversalUnit::Multi ), mmHeight.value( UniversalUnit::Multi ) );
if ( drawing != NULL )
{
drawing->Inline->BehindDoc = true;
drawing->Inline->Wrap.init();
drawing->Inline->Wrap->Type = "wrapNone";
OOX::Logic::Run run;
run.add( drawing );
this->drawingParagraph.Add( run );
}
}
}
/*========================================================================================================*/
void Page::AddShape( const OOX::Logic::Shape& _shape )
{
OOX::Logic::Pict* pict = new OOX::Logic::Pict();
pict->Name = "pict";
pict->Shape = _shape;
OOX::Logic::Run run;
run.add( pict );
this->drawingParagraph.Add( run );
}
/*========================================================================================================*/
void Page::PathMoveTo( double _dX, double _dY )
{
this->vmlGraphicsPath.MoveTo( _dX, _dY );
}
/*========================================================================================================*/
void Page::PathLineTo( double _dX, double _dY )
{
this->vmlGraphicsPath.LineTo( _dX, _dY );
}
/*========================================================================================================*/
void Page::PathLinesTo( const std::vector<double>& _points )
{
this->vmlGraphicsPath.LinesTo( _points );
}
/*========================================================================================================*/
void Page::PathCurveTo( double _x1, double _y1, double _x2, double _y2, double _x3, double _y3 )
{
this->vmlGraphicsPath.CurveTo( _x1, _y1, _x2, _y2, _x3, _y3 );
}
/*========================================================================================================*/
void Page::PathCurvesTo( const std::vector<double>& _points )
{
this->vmlGraphicsPath.CurvesTo( _points );
}
/*========================================================================================================*/
void Page::PathArcTo( double _x, double _y, double _width, double _height, double _startAngle, double _sweepAngle )
{
this->vmlGraphicsPath.ArcTo( _x, _y, _width, _height, _startAngle, _sweepAngle );
}
/*========================================================================================================*/
void Page::PathClose()
{
this->vmlGraphicsPath.Close();
}
/*========================================================================================================*/
void Page::PathEnd()
{
this->vmlGraphicsPath.Reset();
}
/*========================================================================================================*/
void Page::DrawPath( long _nType, unsigned int _resize )
{
bool stroked = ( 0x01 == ( _nType & 0x01 ) );
bool filled = ( ( ( _nType & 0x300 ) != 0 ) ? true : false );
this->AddShape( this->vmlGraphicsPath.GetShape( stroked, filled, _resize ) );
}
/*========================================================================================================*/
void Page::PathStart()
{
//!!!TODO!!!
}
/*========================================================================================================*/
void Page::PathGetCurrentPoint( double* _dX, double* _dY )
{
if ( ( _dX != NULL ) && ( _dY != NULL ) )
{
std::vector<std::pair<double, double> > pathPoints = this->vmlGraphicsPath.GetPathPoints();
if ( !pathPoints.empty() )
{
*_dX = pathPoints.back().first;
*_dY = pathPoints.back().second;
}
}
}
/*========================================================================================================*/
void Page::GetCommandParams( double* _dAngle, double* _dLeft, double* _dTop, double* _dWidth, double* _dHeight, unsigned long* _lFlags )
{
if ( NULL != _dAngle )
{
*_dAngle = this->dAngle;
}
if ( NULL != _dLeft )
{
*_dLeft = this->dLeft;
}
if ( NULL != _dTop )
{
*_dTop = this->dTop;
}
if ( NULL != _dWidth )
{
*_dWidth = this->dWidth;
}
if ( NULL != _dHeight )
{
*_dHeight = this->dHeight;
}
if ( NULL != _lFlags )
{
*_lFlags = this->lFlags;
}
}
/*========================================================================================================*/
void Page::SetCommandParams( double _dAngle, double _dLeft, double _dTop, double _dWidth, double _dHeight, unsigned long _lFlags )
{
this->dAngle = _dAngle;
this->dLeft = _dLeft;
this->dTop = _dTop;
this->dWidth = _dWidth;
this->dHeight = _dHeight;
this->lFlags = _lFlags;
if ( ( _dWidth <= 1 ) || ( _dHeight <= 1 ) )
{
_lFlags = 0;
}
bool bFlipX = ( 0 != ( c_nParamFlipX & _lFlags ) );
bool bFlipY = ( 0 != ( c_nParamFlipY & _lFlags ) );
double m11 = ( bFlipX ? -1.0f : 1.0f );
double m22 = ( bFlipY ? -1.0f : 1.0f );
DocxRenderer::TransformationMatrix matrix( 1, 0, 0, 1, 0, 0 );
if ( ( 0 != this->dAngle ) || ( 0 != _lFlags ) )
{
double dCentreX = ( _dLeft + ( _dWidth / 2.0 ) );
double dCentreY = ( _dTop + ( _dHeight / 2.0 ) );
matrix.Translate( -dCentreX, -dCentreY, DocxRenderer::TransformationMatrix::MatrixOrderAppend );
matrix.Rotate( this->dAngle, DocxRenderer::TransformationMatrix::MatrixOrderAppend );
matrix.Scale( m11, m22, DocxRenderer::TransformationMatrix::MatrixOrderAppend );
matrix.Translate( dCentreX, dCentreY, DocxRenderer::TransformationMatrix::MatrixOrderAppend );
}
this->SetTransform( matrix );
}
/*========================================================================================================*/
void Page::SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF )
{
this->matrix.SetTransform( _dA, _dB, _dC, _dD, _dE, _dF );
this->vmlGraphicsPath.SetTransform( _dA, _dB, _dC, _dD, _dE, _dF );
}
/*========================================================================================================*/
void Page::SetTransform( const TransformationMatrix& _matrix )
{
double dA = 0;
double dB = 0;
double dC = 0;
double dD = 0;
double dE = 0;
double dF = 0;
_matrix.GetTransform( &dA, &dB, &dC, &dD, &dE, &dF );
this->SetTransform( dA, dB, dC, dD, dE, dF );
}
/*========================================================================================================*/
void Page::GetTransform( double* _pdA, double* _pdB, double* _pdC, double* _pdD, double* _pdE, double* _pdF )
{
this->matrix.GetTransform( _pdA, _pdB, _pdC, _pdD, _pdE, _pdF );
}
/*========================================================================================================*/
void Page::ResetTransform()
{
this->matrix.ResetTransform();
this->vmlGraphicsPath.ResetTransform();
}
/*========================================================================================================*/
long Page::GetClipMode()
{
//!!!TODO!!!
return 0;
}
/*========================================================================================================*/
void Page::SetClipMode( long _lMode )
{
//!!!TODO!!!
}
/*========================================================================================================*/
void Page::PathText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset )
{
//!!!TODO!!!
}
/*========================================================================================================*/
void Page::SetPenColor( const std::string& _penColor )
{
this->penColor = _penColor;
this->vmlGraphicsPath.SetPenColor( this->penColor );
}
/*========================================================================================================*/
void Page::SetPenSize( double _penSize )
{
this->penSize = _penSize;
UniversalUnit penSizeMm( UniversalUnit::Mm );
UniversalUnit penSizePt( UniversalUnit::Pt );
penSizeMm = this->penSize;
penSizePt = penSizeMm;
this->vmlGraphicsPath.SetPenSize( penSizePt.ToString() );
}
/*========================================================================================================*/
void Page::SetFontColor( const std::string& _fontColor )
{
this->fontColor = _fontColor;
}
/*========================================================================================================*/
void Page::SetBrushColor( const std::string& _brushColor )
{
this->brushColor = _brushColor;
this->vmlGraphicsPath.SetBrushColor( this->brushColor );
}
/*========================================================================================================*/
void Page::SetFontName( const std::string& _fontName )
{
this->fontName = _fontName;
}
/*========================================================================================================*/
void Page::SetFontSize( double _fontSize )
{
this->fontSize = _fontSize;
}
/*========================================================================================================*/
void Page::SetBold( bool _value )
{
this->bold = _value;
}
/*========================================================================================================*/
void Page::SetItalic( bool _value )
{
this->italic = _value;
}
/*========================================================================================================*/
void Page::SetUnderline( bool _value )
{
this->underline = _value;
}
/*========================================================================================================*/
void Page::SetStrikeout( bool _value )
{
this->strikeout = _value;
}
/*========================================================================================================*/
void Page::Build() const
{
switch ( this->textAssociationType )
{
case TextAssociationTypeDefault:
{
for ( std::vector<PageString>::iterator iter = this->strings.begin(); iter != this->strings.end(); ++iter )
{
OOX::Logic::ParagraphProperty paragraphProperty;
paragraphProperty.TextFrameProperties = OOXUtils::GetTextFrameProperties( iter->GetXStart(), ( iter->GetY() - iter->GetHeight() ) );
iter->SetParagraphProperties( paragraphProperty );
}
}
break;
case TextAssociationTypeLine:
{
for ( std::vector<PageString>::iterator iter = this->strings.begin(); iter != this->strings.end(); ++iter )
{
OOX::Logic::ParagraphProperty paragraphProperty;
paragraphProperty.TextFrameProperties = OOXUtils::GetTextFrameProperties( iter->GetXStart(), ( iter->GetY() - iter->GetHeight() ) );
iter->SetParagraphProperties( paragraphProperty );
}
}
break;
case TextAssociationTypeBlock:
{
//!!!TODO!!!
if ( !this->strings.empty() )
{
std::vector<PageString>::iterator currentPageStringIter = this->strings.begin();
std::vector<PageString>::iterator nextPageStringIter = ++this->strings.begin();
OOX::Logic::ParagraphProperty paragraphProperty;
paragraphProperty.TextFrameProperties = OOXUtils::GetTextFrameProperties( currentPageStringIter->GetXStart(), ( currentPageStringIter->GetY() - currentPageStringIter->GetHeight() ) );
currentPageStringIter->SetParagraphProperties( paragraphProperty );
for ( ; nextPageStringIter != this->strings.end(); ++nextPageStringIter )
{
if ( ( ( fabs( nextPageStringIter->GetY() - nextPageStringIter->GetHeight() - currentPageStringIter->GetY() ) > STANDART_STRING_HEIGHT_MM ) &&
( nextPageStringIter->GetXStart() == currentPageStringIter->GetXStart() ) ) ||
( ( nextPageStringIter->GetXStart() != currentPageStringIter->GetXStart() ) &&
( nextPageStringIter->GetY() != currentPageStringIter->GetY() ) ) )
{
paragraphProperty.TextFrameProperties = OOXUtils::GetTextFrameProperties( nextPageStringIter->GetXStart(), ( nextPageStringIter->GetY() - nextPageStringIter->GetHeight() ) );
}
nextPageStringIter->SetParagraphProperties( paragraphProperty );
currentPageStringIter = nextPageStringIter;
}
}
}
break;
case TextAssociationTypeNoFrames:
{
std::vector<PageString> sortedStrings( this->strings.begin(), this->strings.end() );
std::sort( sortedStrings.begin(), sortedStrings.end(), PageString::LessYPosition );
this->sortedStrings.assign( sortedStrings.begin(), sortedStrings.end() );
sortedStrings.clear();
PageString::Merge( this->sortedStrings, ( STANDART_STRING_HEIGHT_MM / 3 ) );
double previousStringOffset = 0;
UniversalUnit mmValue( UniversalUnit::Mm );
UniversalUnit dxValue( UniversalUnit::Dx );
for ( std::list<PageString>::iterator iter = this->sortedStrings.begin(); iter != this->sortedStrings.end(); ++iter )
{
mmValue = iter->GetXStart();
dxValue = mmValue;
OOX::Logic::ParagraphProperty paragraphProperty;
paragraphProperty.Ind.init();
paragraphProperty.Ind->Left = dxValue;
double beforeSpacing = ( iter->GetY() - previousStringOffset - iter->GetHeight() );
if ( beforeSpacing > 0 )
{
mmValue = fabs( beforeSpacing );
dxValue = mmValue;
}
else
{
dxValue = 0;
}
paragraphProperty.Spacing.init();
paragraphProperty.Spacing->Before = dxValue;
if ( iter->GetHeight() == 0 )
{
dxValue = 1;
}
else
{
if ( beforeSpacing < 0 )
{
mmValue = ( iter->GetHeight() + beforeSpacing );
}
else
{
mmValue = iter->GetHeight();
}
dxValue = mmValue;
}
paragraphProperty.Spacing->Line = dxValue;
paragraphProperty.Spacing->LineRule = "exact";
iter->SetParagraphProperties( paragraphProperty );
previousStringOffset = iter->GetY();
}
}
break;
}
}
/*========================================================================================================*/
std::vector<OOX::Logic::Paragraph> Page::GetParagraphs() const
{
std::vector<OOX::Logic::Paragraph> paragraphs;
if ( !this->drawingParagraph.Items->empty() )
{
paragraphs.push_back( this->drawingParagraph );
}
if ( this->textAssociationType != TextAssociationTypeNoFrames )
{
for ( std::vector<PageString>::const_iterator iter = this->strings.begin(); iter != this->strings.end(); ++iter )
{
paragraphs.push_back( iter->GetParagraph() );
}
}
else
{
std::list<PageString>::iterator iter = this->sortedStrings.begin();
while ( !this->sortedStrings.empty() )
{
paragraphs.push_back( iter->GetParagraph() );
iter = this->sortedStrings.erase( iter );
}
}
if ( ( this->width > 0 ) || ( this->height > 0 ) )
{
OOX::Logic::SectorProperty sectionProperties;
UniversalUnit mmValue( UniversalUnit::Mm );
UniversalUnit dxValue( UniversalUnit::Dx );
mmValue = this->width;
dxValue = mmValue;
sectionProperties.PageSize->Width = dxValue;
mmValue = this->height;
dxValue = mmValue;
sectionProperties.PageSize->Height = dxValue;
if(this->width <= this->height )
sectionProperties.PageSize->Orient = "portrait";
else
sectionProperties.PageSize->Orient = "landscape";
OOX::Logic::Paragraph sectionParagraph;
sectionParagraph.Property.init();
sectionParagraph.Property->Spacing.init();
sectionParagraph.Property->Spacing->Line = 1;
sectionParagraph.Property->Spacing->LineRule = "exact";
sectionParagraph.Property->SectorProperty = sectionProperties;
paragraphs.push_back( sectionParagraph );
}
return paragraphs;
}
/*========================================================================================================*/
unsigned int Page::GetParagraphsCount() const
{
unsigned int paragraphsCount = 0;
if ( !this->drawingParagraph.Items->empty() )
{
paragraphsCount++;
}
paragraphsCount += (unsigned int)this->strings.size();
return paragraphsCount;
}
}
\ No newline at end of file
#pragma once
#include "PageString.h"
namespace DocxRenderer
{
class Page
{
private:
bool hyperlinkMode;
bool clipMode;
double width;
double height;
mutable std::vector<PageString> strings;
mutable std::list<PageString> sortedStrings;
DocxRenderer::VMLGraphicsPath vmlGraphicsPath;
OOX::Logic::Paragraph drawingParagraph;
TransformationMatrix matrix;
TextAssociationType textAssociationType;
Docx::Folder* ooxFolder;
FontManager* fontManager;
std::string penColor;
double penSize;
std::string fontColor;
std::string brushColor;
std::string fontName;
double fontSize;
bool bold;
bool italic;
bool underline;
bool strikeout;
double dAngle;
double dLeft;
double dTop;
double dWidth;
double dHeight;
unsigned long lFlags;
static const double STANDART_STRING_HEIGHT_MM;
static const double THE_SAME_STRING_Y_PRECISION_MM;
private:
OOX::Logic::RunProperty GetRunProperties() const;
PageString* GetPageString( double _y ) const;
public:
Page();
Page( Docx::Folder* _ooxFolder, FontManager* _fontManager, TextAssociationType _textAssociationType = TextAssociationTypeDefault, double _width = 0, double _height = 0 );
void SetWidth( double _width );
double GetWidth() const;
void SetGraphicsWidth( double _width );
void SetHeight( double _height );
double GetHeight() const;
void SetGraphicsHeight( double _height );
void SetTextAssociationType( TextAssociationType _textAssociationType );
TextAssociationType GetTextAssociationType() const;
void BeginCommand( unsigned long _lType );
void EndCommand( unsigned long _lType );
void SetOOXFolder( Docx::Folder* _ooxFolder );
void SetFontManager( FontManager* _fontManager );
void AddText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset, double _xRestriction = 0, double _yRestriction = 0, const std::wstring& _gidText = _T( "" ) );
void AddImage( const std::wstring& _fileName, double _dX, double _dY, double _dWidth, double _dHeight );
void AddShape( const OOX::Logic::Shape& _shape );
void PathMoveTo( double _dX, double _dY );
void PathLineTo( double _dX, double _dY );
void PathLinesTo( const std::vector<double>& _points );
void PathCurveTo( double _x1, double _y1, double _x2, double _y2, double _x3, double _y3 );
void PathCurvesTo( const std::vector<double>& _points );
void PathArcTo( double _x, double _y, double _width, double _height, double _startAngle, double _sweepAngle );
void PathClose();
void PathEnd();
void DrawPath( long _nType, unsigned int _resize = 1000000 );
void PathStart();
void PathGetCurrentPoint( double* _dX, double* _dY );
void GetCommandParams( double* _dAngle, double* _dLeft, double* _dTop, double* _dWidth, double* _dHeight, unsigned long* _lFlags );
void SetCommandParams( double _dAngle, double _dLeft, double _dTop, double _dWidth, double _dHeight, unsigned long _lFlags );
void SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF );
void SetTransform( const TransformationMatrix& _matrix );
void GetTransform( double* _pdA, double* _pdB, double* _pdC, double* _pdD, double* _pdE, double* _pdF );
void ResetTransform();
long GetClipMode();
void SetClipMode( long _lMode );
void PathText( const std::wstring& _text, double _dX, double _dY, double _dWidth, double _dHeight, double _dBaseLineOffset );
void SetPenColor( const std::string& _penColor );
void SetPenSize( double _penSize );
void SetFontColor( const std::string& _fontColor );
void SetBrushColor( const std::string& _brushColor );
void SetFontName( const std::string& _fontName );
void SetFontSize( double _fontSize );
void SetBold( bool _value );
void SetItalic( bool _value );
void SetUnderline( bool _value );
void SetStrikeout( bool _value );
void Build() const;
std::vector<OOX::Logic::Paragraph> GetParagraphs() const;
unsigned int GetParagraphsCount() const;
};
}
\ No newline at end of file
#include "stdafx.h"
#include "PageString.h"
namespace DocxRenderer
{
PageString::PageString():
xStart(0), y(0), height(0), fontManager(NULL)
{
}
/*========================================================================================================*/
PageString::PageString( double _y, FontManager* _fontManager ):
xStart(0), y(0), height(0), fontManager(_fontManager)
{
if ( _y > 0 )
{
this->y = _y;
}
}
/*========================================================================================================*/
PageString::PageString( const std::wstring& _text, const std::wstring& _gidText, const OOX::Logic::RunProperty& _properties, double _x, double _y, FontManager* _fontManager ):
xStart(0), y(0), height(0), fontManager(_fontManager)
{
if ( _y > 0 )
{
this->y = _y;
}
this->AddText( _text, _properties, _x, _gidText );
}
/*========================================================================================================*/
long PageString::GetFontStyle( const OOX::Logic::RunProperty& _runProperty ) const
{
long fontStyle = 0;
if ( _runProperty.Bold.get_value_or_default() )
{
fontStyle |= 1;
}
if ( _runProperty.Italic.get_value_or_default() )
{
fontStyle |= 2;
}
if ( _runProperty.Under.get_value_or_default() )
{
fontStyle |= 4;
}
if ( _runProperty.Strike.get_value_or_default() )
{
fontStyle |= 8;
}
return fontStyle;
}
/*========================================================================================================*/
bool operator == ( const OOX::Logic::RunProperty& _runProperty1, const OOX::Logic::RunProperty& _runProperty2 )
{
bool result = true;
if ( ( _runProperty1.FontColor.is_init() && !_runProperty2.FontColor.is_init() ) ||
( !_runProperty1.FontColor.is_init() && _runProperty2.FontColor.is_init() ) ||
( _runProperty1.FontColor.is_init() && _runProperty2.FontColor.is_init() &&
( ( _runProperty1.FontColor->Blue != _runProperty2.FontColor->Blue ) ||
( _runProperty1.FontColor->Green != _runProperty2.FontColor->Green ) ||
( _runProperty1.FontColor->Red != _runProperty2.FontColor->Red ) ) ) )
{
result = false;
}
if ( ( _runProperty1.RFonts.is_init() && !_runProperty2.RFonts.is_init() ) ||
( !_runProperty1.RFonts.is_init() && _runProperty2.RFonts.is_init() ) ||
( _runProperty1.RFonts.is_init() && _runProperty2.RFonts.is_init() &&
( _runProperty1.RFonts->Ascii != _runProperty2.RFonts->Ascii ) ) )
{
result = false;
}
if ( ( _runProperty1.FontSize.is_init() && !_runProperty2.FontSize.is_init() ) ||
( !_runProperty1.FontSize.is_init() && _runProperty2.FontSize.is_init() ) ||
( _runProperty1.FontSize.is_init() && _runProperty2.FontSize.is_init() &&
( _runProperty1.FontSize != _runProperty2.FontSize ) ) )
{
result = false;
}
if ( ( _runProperty1.Bold.is_init() && !_runProperty2.Bold.is_init() ) ||
( !_runProperty1.Bold.is_init() && _runProperty2.Bold.is_init() ) ||
( _runProperty1.Bold.is_init() && _runProperty2.Bold.is_init() &&
( _runProperty1.Bold != _runProperty2.Bold ) ) )
{
result = false;
}
if ( ( _runProperty1.Italic.is_init() && !_runProperty2.Italic.is_init() ) ||
( !_runProperty1.Italic.is_init() && _runProperty2.Italic.is_init() ) ||
( _runProperty1.Italic.is_init() && _runProperty2.Italic.is_init() &&
( _runProperty1.Italic != _runProperty2.Italic ) ) )
{
result = false;
}
if ( ( _runProperty1.Strike.is_init() && !_runProperty2.Strike.is_init() ) ||
( !_runProperty1.Strike.is_init() && _runProperty2.Strike.is_init() ) ||
( _runProperty1.Strike.is_init() && _runProperty2.Strike.is_init() &&
( _runProperty1.Strike != _runProperty2.Strike ) ) )
{
result = false;
}
if ( ( _runProperty1.Under.is_init() && !_runProperty2.Under.is_init() ) ||
( !_runProperty1.Under.is_init() && _runProperty2.Under.is_init() ) ||
( _runProperty1.Under.is_init() && _runProperty2.Under.is_init() &&
( _runProperty1.Under != _runProperty2.Under ) ) )
{
result = false;
}
return result;
}
/*========================================================================================================*/
double PageString::GetMinSymbolWidth() const
{
double minSymbolWidth = DBL_MAX;
for ( std::map<double, Element>::const_iterator iter = this->elements.begin(); iter != this->elements.end(); ++iter )
{
if ( iter->second.width < minSymbolWidth )
{
minSymbolWidth = iter->second.width;
}
}
return minSymbolWidth;
}
/*========================================================================================================*/
double PageString::GetMaxSymbolWidth() const
{
double maxSymbolWidth = 0;
for ( std::map<double, Element>::const_iterator iter = this->elements.begin(); iter != this->elements.end(); ++iter )
{
if ( iter->second.width > maxSymbolWidth )
{
maxSymbolWidth = iter->second.width;
}
}
return maxSymbolWidth;
}
/*========================================================================================================*/
double PageString::GetXStart() const
{
return this->xStart;
}
/*========================================================================================================*/
double PageString::GetY() const
{
return this->y;
}
/*========================================================================================================*/
double PageString::GetWidth() const
{
double width = 0;
for ( std::map<double, Element>::const_iterator iter = this->elements.begin(); iter != this->elements.end(); ++iter )
{
double xOffset = ( iter->first - this->xStart - width );
width += iter->second.width;
width += xOffset;
}
return width;
}
/*========================================================================================================*/
double PageString::GetHeight() const
{
return this->height;
}
/*========================================================================================================*/
bool PageString::IsEmpty() const
{
return this->elements.empty();
}
/*========================================================================================================*/
OOX::Logic::Paragraph PageString::GetParagraph() const
{
OOX::Logic::Paragraph paragraph;
double width = 0;
UniversalUnit mmValue( UniversalUnit::Mm );
UniversalUnit dxValue( UniversalUnit::Dx );
std::map<double, Element>::const_iterator iter = this->elements.begin();
if ( iter != this->elements.end() )
{
OOX::Logic::Run run;
std::string runText;
runText += iter->second.text;
run.Property = iter->second.properties;
double xOffset = ( iter->first - this->xStart - width );
double gidXOffset = 0;
width += iter->second.width;
width += xOffset;
double maxSymbolWidth = 0;
double gidXOffsetPrecision = 0;
if ( !iter->second.gidText.empty() )
{
maxSymbolWidth = this->GetMaxSymbolWidth();
gidXOffsetPrecision = this->GetMinSymbolWidth();
}
std::map<double, Element>::const_iterator prevIter = iter++;
for ( ; iter != this->elements.end(); ++iter )
{
double spaceWidth = 0;
double totalWidth = 0;
double pairWidth = 0;
if ( iter->second.gidText.empty() )
{
spaceWidth = this->fontManager->GetTextWidth( _T( " " ), ::ToWString( *iter->second.properties.RFonts->HAnsi ), ( *iter->second.properties.FontSize / 2 ), this->GetFontStyle( iter->second.properties ), FontManager::MeasureTypePosition );
}
else
{
totalWidth = ( iter->first - prevIter->first + iter->second.width );
pairWidth = ( iter->second.width + prevIter->second.width );
}
xOffset = ( iter->first - this->xStart - width );
width += iter->second.width;
width += xOffset;
gidXOffset = ( totalWidth - pairWidth );
if ( ( ( xOffset > spaceWidth ) && ( xOffset < ( 5 * spaceWidth ) ) && iter->second.gidText.empty() ) ||
( ( gidXOffset > gidXOffsetPrecision ) && ( gidXOffset < maxSymbolWidth ) && !iter->second.gidText.empty() ) && ( prevIter->second.text != " " ) )
{
OOX::Logic::Run spaceRun;
run.add( new OOX::Logic::Text( runText ) );
paragraph.Add( run );
runText.clear();
run.clear();
run.Property.reset();
spaceRun.add( new OOX::Logic::Text( ToString( " " ) ) );
spaceRun.Property = iter->second.properties;
paragraph.Add( spaceRun );
runText += iter->second.text;
run.Property = iter->second.properties;
}
else if ( ( ( xOffset >= ( 5 * spaceWidth ) ) && iter->second.gidText.empty() ) ||
( ( gidXOffset >= maxSymbolWidth ) && !iter->second.gidText.empty() ) )
{
OOX::Logic::Run spaceRun;
run.add( new OOX::Logic::Text( runText ) );
paragraph.Add( run );
runText.clear();
run.clear();
run.Property.reset();
spaceRun.add( new OOX::Logic::Text( ToString( " " ) ) );
spaceRun.Property = iter->second.properties;
if ( iter->second.gidText.empty() )
{
mmValue = ( xOffset - spaceWidth );
}
else
{
mmValue = ( iter->first - prevIter->first - prevIter->second.width );
}
dxValue = mmValue;
spaceRun.Property->RFonts = iter->second.properties.RFonts;
spaceRun.Property->FontSize = iter->second.properties.FontSize;
spaceRun.Property->Spacing = dxValue;
paragraph.Add( spaceRun );
runText += iter->second.text;
run.Property = iter->second.properties;
}
else
{
if ( *run.Property == iter->second.properties )
{
runText += iter->second.text;
}
else
{
run.add( new OOX::Logic::Text( runText ) );
paragraph.Add( run );
runText.clear();
run.clear();
run.Property.reset();
runText += iter->second.text;
run.Property = iter->second.properties;
}
}
prevIter = iter;
}
if ( !runText.empty() )
{
run.add( new OOX::Logic::Text( runText ) );
paragraph.Add( run );
}
}
paragraph.Property = this->paragraphProperties;
return paragraph;
}
/*========================================================================================================*/
void PageString::SetParagraphProperties( const OOX::Logic::ParagraphProperty& _paragraphProperties )
{
this->paragraphProperties = _paragraphProperties;
}
/*========================================================================================================*/
void PageString::SetFontManager( FontManager* _fontManager )
{
this->fontManager = _fontManager;
}
/*========================================================================================================*/
void PageString::AddText( const std::wstring& _text, const OOX::Logic::RunProperty& _properties, double _x, const std::wstring& _gidText )
{
if ( ( _x > 0 ) && ( ( this->xStart == 0 ) || ( _x < this->xStart ) ) )
{
this->xStart = _x;
}
long fontStyle = this->GetFontStyle( _properties );
double textWidth = 0;
double textHeight = 0;
if ( _gidText.empty() )
{
textWidth = this->fontManager->GetTextWidth( _text, ::ToWString( *_properties.RFonts->HAnsi ), ( *_properties.FontSize / 2 ), fontStyle, FontManager::MeasureTypePosition );
textHeight = this->fontManager->GetFontHeight( ::ToWString( *_properties.RFonts->HAnsi ), ( *_properties.FontSize / 2 ), fontStyle );
}
else
{
textWidth = this->fontManager->GetTextWidth( _gidText, FontManager::MeasureTypePosition, true );
textHeight = this->fontManager->GetFontHeight( *_properties.FontSize / 2 );
}
if ( textHeight > this->height )
{
this->height = textHeight;
}
this->elements.insert( std::make_pair( _x, Element( ToString( _text ), _properties, textWidth, _gidText ) ) );
}
/*========================================================================================================*/
void PageString::Merge( const PageString& _pageString )
{
if ( !_pageString.IsEmpty() )
{
UniversalUnit subPageStringPositionMm( UniversalUnit::Mm );
UniversalUnit subPageStringPositionPt( UniversalUnit::Pt );
subPageStringPositionMm = ( this->y - _pageString.y );
subPageStringPositionPt = subPageStringPositionMm;
if ( _pageString.xStart < this->xStart )
{
this->xStart = _pageString.xStart;
}
if ( _pageString.y <= this->y )
{
this->height = ( this->y - _pageString.y + _pageString.height );
}
else
{
this->height = ( _pageString.y - this->y + this->height );
}
for ( std::map<double, Element>::const_iterator iter = _pageString.elements.begin(); iter != _pageString.elements.end(); ++iter )
{
OOX::Logic::RunProperty properties = iter->second.properties;
double position = subPageStringPositionPt;
properties.Position = position;
Element newElement( iter->second.text, properties, iter->second.width, iter->second.gidText );
this->elements.insert( std::make_pair( iter->first, newElement ) );
}
}
}
/*========================================================================================================*/
bool PageString::LessYPosition( const PageString& _pageString1, const PageString& _pageStrig2 )
{
return ( ( _pageString1.GetY() < _pageStrig2.GetY() ) ? true : false );
}
/*========================================================================================================*/
void PageString::Merge( std::list<PageString>& _pageStrings, double _affinity )
{
if ( !_pageStrings.empty() )
{
std::list<PageString>::iterator currentIter = _pageStrings.begin();
std::list<PageString>::iterator nextIter = ++_pageStrings.begin();
while ( nextIter != _pageStrings.end() )
{
if ( fabs( currentIter->GetY() - nextIter->GetY() ) < _affinity )
{
currentIter->Merge( *nextIter );
nextIter = _pageStrings.erase( nextIter );
continue;
}
currentIter = nextIter;
nextIter++;
}
}
}
}
\ No newline at end of file
#pragma once
#include "FontManager.h"
#include "OOXUtils.h"
#include "TransformationMatrix.h"
#include "VMLGraphicsPath.h"
#include <limits>
namespace DocxRenderer
{
enum TextAssociationType
{
TextAssociationTypeDefault = 0,
TextAssociationTypeLine,
TextAssociationTypeNoFrames,
TextAssociationTypeBlock
};
class PageString
{
private:
struct Element
{
std::string text;
OOX::Logic::RunProperty properties;
double width;
std::wstring gidText; //!!!For PDF!!!
Element( const std::string& _text, const OOX::Logic::RunProperty& _properties, double _width, const std::wstring& _gidText = _T( "" ) ):
text(_text), properties(_properties), width(_width), gidText(_gidText)
{
}
};
double xStart;
double y;
double height;
std::map<double, Element> elements;
OOX::Logic::ParagraphProperty paragraphProperties;
FontManager* fontManager;
private:
long GetFontStyle( const OOX::Logic::RunProperty& _runProperty ) const;
friend bool operator == ( const OOX::Logic::RunProperty& _runProperty1, const OOX::Logic::RunProperty& _runProperty2 );
double GetMinSymbolWidth() const;
double GetMaxSymbolWidth() const;
public:
PageString();
PageString( double _y, FontManager* _fontManager );
PageString( const std::wstring& _text, const std::wstring& _gidText, const OOX::Logic::RunProperty& _properties, double _x, double _y, FontManager* _fontManager );
double GetXStart() const;
double GetY() const;
double GetWidth() const;
double GetHeight() const;
bool IsEmpty() const;
OOX::Logic::Paragraph GetParagraph() const;
void SetParagraphProperties( const OOX::Logic::ParagraphProperty& _paragraphProperties );
void SetFontManager( FontManager* _fontManager );
void AddText( const std::wstring& _text, const OOX::Logic::RunProperty& _properties, double _x, const std::wstring& _gidText = _T( "" ) );
void Merge( const PageString& _pageString );
static bool LessYPosition( const PageString& _pageString1, const PageString& _pageStrig2 );
static void Merge( std::list<PageString>& _pageStrings, double _affinity );
};
}
\ No newline at end of file
========================================================================
ACTIVE TEMPLATE LIBRARY : ASCOfficeDocxRenderer Project Overview
========================================================================
AppWizard has created this ASCOfficeDocxRenderer project for you to use as the starting point for
writing your Dynamic Link Library (DLL).
This project is implemented with Visual C++ attributes.
This file contains a summary of what you will find in each of the files that
make up your project.
ASCOfficeDocxRenderer.vcproj
This is the main project file for VC++ projects generated using an Application Wizard.
It contains information about the version of Visual C++ that generated the file, and
information about the platforms, configurations, and project features selected with the
Application Wizard.
_ASCOfficeDocxRenderer.idl
This file will be generated by the compiler when the project is built. It will contain the IDL
definitions of the type library, the interfaces and co-classes defined in your project.
This file will be processed by the MIDL compiler to generate:
C++ interface definitions and GUID declarations (_ASCOfficeDocxRenderer.h)
GUID definitions (_ASCOfficeDocxRenderer_i.c)
A type library (_ASCOfficeDocxRenderer.tlb)
Marshaling code (_ASCOfficeDocxRenderer_p.c and dlldata.c)
ASCOfficeDocxRenderer.cpp
This file contains the object map and the implementation of your DLL's exports.
ASCOfficeDocxRenderer.rc
This is a listing of all of the Microsoft Windows resources that the
program uses.
ASCOfficeDocxRenderer.def
This module-definition file provides the linker with information about the exports
required by your DLL. It contains exports for:
DllGetClassObject
DllCanUnloadNow
GetProxyDllInfo
DllRegisterServer
DllUnregisterServer
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named ASCOfficeDocxRenderer.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file that defines resource IDs.
/////////////////////////////////////////////////////////////////////////////
Proxy/stub DLL project and module definition file:
ASCOfficeDocxRendererps.vcproj
This file is the project file for building a proxy/stub DLL if necessary.
The IDL file in the main project must contain at least one interface and you must
first compile the IDL file before building the proxy/stub DLL. This process generates
dlldata.c, ASCOfficeDocxRenderer_i.c and ASCOfficeDocxRenderer_p.c which are required
to build the proxy/stub DLL.
ASCOfficeDocxRendererps.def
This module definition file provides the linker with information about the exports
required by the proxy/stub.
/////////////////////////////////////////////////////////////////////////////
#pragma once
template <class T> class Singleton
{
private:
static T* _self;
protected:
Singleton() {}
virtual ~Singleton() { _self = NULL; }
public:
static T* Instance();
void FreeInstance();
};
template <class T> T* Singleton<T>::_self = NULL;
template <class T> T* Singleton<T>::Instance()
{
if( _self == NULL )
{
_self = new T;
}
return _self;
}
template <class T> void Singleton<T>::FreeInstance()
{
delete this;
}
\ No newline at end of file
#include "stdafx.h"
#include "TransformationMatrix.h"
namespace DocxRenderer
{
const double DocxRenderer::TransformationMatrix::PI = 3.14159265358979323846;
TransformationMatrix::TransformationMatrix():
dA(1), dB(0), dC(0), dD(1), dE(0), dF(0)
{
}
/*========================================================================================================*/
TransformationMatrix::TransformationMatrix( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF ):
dA(_dA), dB(_dB), dC(_dC), dD(_dD), dE(_dE), dF(_dF)
{
}
/*========================================================================================================*/
void TransformationMatrix::SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF )
{
this->dA = _dA;
this->dB = _dB;
this->dC = _dC;
this->dD = _dD;
this->dE = _dE;
this->dF = _dF;
}
/*========================================================================================================*/
void TransformationMatrix::ResetTransform()
{
this->dA = 1;
this->dB = 0;
this->dC = 0;
this->dD = 1;
this->dE = 0;
this->dF = 0;
}
/*========================================================================================================*/
void TransformationMatrix::GetTransform( double* _pdA, double* _pdB, double* _pdC, double* _pdD, double* _pdE, double* _pdF ) const
{
if ( _pdA != NULL )
{
*_pdA = this->dA;
}
if ( _pdB != NULL )
{
*_pdB = this->dB;
}
if ( _pdC != NULL )
{
*_pdC = this->dC;
}
if ( _pdD != NULL )
{
*_pdD = this->dD;
}
if ( _pdE != NULL )
{
*_pdE = this->dE;
}
if ( _pdF != NULL )
{
*_pdF = this->dF;
}
}
/*========================================================================================================*/
double TransformationMatrix::GetA() const
{
return this->dA;
}
/*========================================================================================================*/
double TransformationMatrix::GetB() const
{
return this->dB;
}
/*========================================================================================================*/
double TransformationMatrix::GetC() const
{
return this->dC;
}
/*========================================================================================================*/
double TransformationMatrix::GetD() const
{
return this->dD;
}
/*========================================================================================================*/
double TransformationMatrix::GetE() const
{
return this->dE;
}
/*========================================================================================================*/
double TransformationMatrix::GetF() const
{
return this->dF;
}
/*========================================================================================================*/
void TransformationMatrix::Multiply( const TransformationMatrix& _matrix, MatrixOrder matrixOrder )
{
double newA = this->dA;
double newB = this->dB;
double newC = this->dC;
double newD = this->dD;
double newE = this->dE;
double newF = this->dF;
if ( matrixOrder == MatrixOrderPrepend )
{
newA = ( ( _matrix.dA * this->dA ) + ( _matrix.dB * this->dC ) );
newB = ( ( _matrix.dA * this->dB ) + ( _matrix.dB * this->dD ) );
newC = ( ( _matrix.dC * this->dA ) + ( _matrix.dD * this->dC ) );
newD = ( ( _matrix.dC * this->dB ) + ( _matrix.dD * this->dD ) );
newE = ( ( _matrix.dE * this->dA ) + ( _matrix.dF * this->dC ) + this->dE );
newF = ( ( _matrix.dE * this->dB ) + ( _matrix.dF * this->dD ) + this->dF );
}
else if ( matrixOrder == MatrixOrderAppend )
{
newA = ( ( this->dA * _matrix.dA ) + ( this->dB * _matrix.dC ) );
newB = ( ( this->dA * _matrix.dB ) + ( this->dB * _matrix.dD ) );
newC = ( ( this->dC * _matrix.dA ) + ( this->dD * _matrix.dC ) );
newD = ( ( this->dC * _matrix.dB ) + ( this->dD * _matrix.dD ) );
newE = ( ( this->dE * _matrix.dA ) + ( this->dF * _matrix.dC ) + _matrix.dE );
newF = ( ( this->dE * _matrix.dB ) + ( this->dF * _matrix.dD ) + _matrix.dF );
}
this->dA = newA;
this->dB = newB;
this->dC = newC;
this->dD = newD;
this->dE = newE;
this->dF = newF;
}
/*========================================================================================================*/
void TransformationMatrix::Rotate( double _angle, MatrixOrder matrixOrder )
{
TransformationMatrix rotationMatrix( cos( _angle * 180 / PI ), sin( _angle * 180 / PI ), -sin( _angle * 180 / PI ), cos( _angle * 180 / PI ), 0, 0 );
this->Multiply( rotationMatrix, matrixOrder );
}
/*========================================================================================================*/
void TransformationMatrix::Scale( double _scaleX, double _scaleY, MatrixOrder matrixOrder )
{
TransformationMatrix scaleMatrix( _scaleX, 0, 0, _scaleY, 0, 0 );
this->Multiply( scaleMatrix, matrixOrder );
}
/*========================================================================================================*/
void TransformationMatrix::Translate( double _offsetX, double _offsetY, MatrixOrder matrixOrder )
{
TransformationMatrix translateMatrix( 1, 0, 0, 1, _offsetX, _offsetY );
this->Multiply( translateMatrix, matrixOrder );
}
/*========================================================================================================*/
void TransformationMatrix::LinearTransform( double& _x, double& _y ) const
{
double x = _x;
double y = _y;
_x = ( ( this->dA * x ) + ( this->dC * y ) );
_y = ( ( this->dB * x ) + ( this->dD * y ) );
}
/*========================================================================================================*/
void TransformationMatrix::AffineTransform( double& _x, double& _y ) const
{
double x = _x;
double y = _y;
_x = ( ( this->dA * x ) + ( this->dC * y ) + this->dE );
_y = ( ( this->dB * x ) + ( this->dD * y ) + this->dF );
}
}
\ No newline at end of file
#pragma once
#include <math.h>
namespace DocxRenderer
{
/*
Matrix is a affine transform in a 2D-coordinate system:
| dA dB 0 |
| dC dD 0 |
| dE dF 1 |
Linear transform:
| dA dB |
| dC dD |
*/
class TransformationMatrix
{
public:
enum MatrixOrder
{
MatrixOrderPrepend = 0,
MatrixOrderAppend
};
static const double PI; //3.14159265358979323846;
private:
double dA;
double dB;
double dC;
double dD;
double dE;
double dF;
public:
TransformationMatrix();
TransformationMatrix( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF );
void SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF );
void GetTransform( double* _pdA, double* _pdB, double* _pdC, double* _pdD, double* _pdE, double* _pdF ) const;
double GetA() const;
double GetB() const;
double GetC() const;
double GetD() const;
double GetE() const;
double GetF() const;
void ResetTransform();
void Multiply( const TransformationMatrix& _matrix, MatrixOrder matrixOrder = MatrixOrderPrepend );
void Rotate( double _angle, MatrixOrder matrixOrder = MatrixOrderPrepend );
void Scale( double _scaleX, double _scaleY, MatrixOrder matrixOrder = MatrixOrderPrepend );
void Translate( double _offsetX, double _offsetY, MatrixOrder matrixOrder = MatrixOrderPrepend );
void LinearTransform( double& _x, double& _y ) const;
void AffineTransform( double& _x, double& _y ) const;
};
}
\ No newline at end of file
#pragma once
#include <boost\scoped_ptr.hpp>
namespace DocxRenderer
{
// CommandParams
static const long c_nParamFlipX = 0x0001;
static const long c_nParamFlipY = 0x0002;
static const long c_nFlipNextRotate = 0x0004;
// BeginCommand, EndCommand
static const long c_nNone = 0x0000;
static const long c_nPageType = 0x0001;
static const long c_nTextType = 0x0002;
static const long c_nPathType = 0x0004;
static const long c_nHyperlinkType = 0x0008;
static const long c_nWatermarkType = 0x0010;
static const long c_nClipType = 0x0020;
static const long c_nResetClipType = 0x0040;
struct IClone
{
virtual ~IClone() {}
virtual IClone* New() const = 0;
virtual IClone* Clone() const = 0;
};
namespace Utils
{
static const double PI = 3.14159265358979323846;
// 2-byte number
inline short little_endian_2_big_endian( short s )
{
return ( ( s >> 8) & 0xff ) + ( ( s << 8 ) & 0xff00 );
}
/*========================================================================================================*/
// 4-byte number
inline int little_endian_2_big_endian( int i )
{
return ( ( i & 0xff ) << 24 ) + ( ( i & 0xff00 ) << 8 ) + ( ( i & 0xff0000 ) >> 8 ) + ( ( i >> 24 ) & 0xff );
}
/*========================================================================================================*/
inline std::string ToHexString( int i )
{
char buffer[( 2 * sizeof(i) ) + 1];
memset( buffer, 0, sizeof(buffer) );
sprintf( buffer, "%08X", i );
return std::string( buffer );
}
/*========================================================================================================*/
inline std::string ToHexString( unsigned int ui )
{
char buffer[( 2 * sizeof(ui) ) + 1];
memset( buffer, 0, sizeof(buffer) );
sprintf( buffer, "%08X", ui );
return std::string( buffer );
}
/*========================================================================================================*/
inline std::string ToHexString( short s )
{
char buffer[( 2 * sizeof(s) ) + 1];
memset( buffer, 0, sizeof(buffer) );
sprintf( buffer, "%04X", s );
return std::string( buffer );
}
/*========================================================================================================*/
inline std::string ToHexString( unsigned short us )
{
char buffer[( 2 * sizeof(us) ) + 1];
memset( buffer, 0, sizeof(buffer) );
sprintf( buffer, "%04X", us );
return std::string( buffer );
}
/*========================================================================================================*/
inline std::string ToHexString( char c )
{
char buffer[( 2 * sizeof(c) ) + 1];
memset( buffer, 0, sizeof(buffer) );
sprintf( buffer, "%02X", c );
return std::string( buffer );
}
/*========================================================================================================*/
inline std::string ToHexString( unsigned char uc )
{
char buffer[( 2 * sizeof(uc) ) + 1];
memset( buffer, 0, sizeof(buffer) );
sprintf( buffer, "%02X", uc );
return std::string( buffer );
}
/*========================================================================================================*/
inline std::wstring GetTempDir()
{
const unsigned short BUFFER_SIZE = 512;
DWORD dwRetVal = 0;
WCHAR lpPathBuffer[BUFFER_SIZE];
std::wstring tempDir;
// Get the temp path.
dwRetVal = GetTempPath( BUFFER_SIZE, // length of the buffer
lpPathBuffer ); // buffer for path
if ( ( dwRetVal <= BUFFER_SIZE ) && ( dwRetVal != 0 ) )
{
tempDir = lpPathBuffer;
}
return tempDir;
}
/*========================================================================================================*/
inline std::wstring GetTempFile( const std::wstring& tempDir, const std::wstring& tempFileNamePrefix, bool unique )
{
const unsigned short BUFFER_SIZE = 512;
UINT uRetVal = 0;
WCHAR lpFileBuffer[BUFFER_SIZE];
std::wstring tempFile;
// Create a temporary file.
uRetVal = GetTempFileName( tempDir.c_str(), // directory for tmp files
tempFileNamePrefix.c_str(), // temp file name prefix
( ( unique ) ? ( 0 ) : ( 1 ) ), // create unique name
lpFileBuffer ); // buffer for name
if ( uRetVal != 0 )
{
tempFile = lpFileBuffer;
}
return tempFile;
}
/*========================================================================================================*/
inline bool IsUnicodeSymbol( WCHAR symbol )
{
bool result = false;
if ( ( 0x0009 == symbol ) || ( 0x000A == symbol ) || ( 0x000D == symbol ) ||
( ( 0x0020 <= symbol ) && ( 0xD7FF >= symbol ) ) || ( ( 0xE000 <= symbol ) && ( symbol <= 0xFFFD ) ) ||
( ( 0x10000 <= symbol ) && symbol ) )
{
result = true;
}
return result;
}
}
}
\ No newline at end of file
#include "stdafx.h"
#include "VMLGraphicsPath.h"
namespace DocxRenderer
{
VMLGraphicsPath::VMLGraphicsPath():
width(0), height(0), closed(false)
{
}
/*========================================================================================================*/
VMLGraphicsPath::VMLGraphicsPath( const std::string& _id, const std::string& _penSize, const std::string& _penColor ):
width(0), height(0), closed(false), id(_id), penSize(_penSize), penColor(_penColor)
{
}
/*========================================================================================================*/
std::string VMLGraphicsPath::GetID() const
{
return this->id;
}
/*========================================================================================================*/
void VMLGraphicsPath::SetID( const std::string& _id )
{
this->id = _id;
}
/*========================================================================================================*/
std::string VMLGraphicsPath::GetPenSize() const
{
return this->penSize;
}
/*========================================================================================================*/
void VMLGraphicsPath::SetPenSize( const std::string& _penSize )
{
this->penSize = _penSize;
}
/*========================================================================================================*/
std::string VMLGraphicsPath::GetPenColor() const
{
return this->penColor;
}
/*========================================================================================================*/
void VMLGraphicsPath::SetPenColor( const std::string& _penColor )
{
if ( _penColor.size() == 8 )
{
this->penColor = _penColor;
//!!!TODO!!!
this->penColor.erase( 6, 2 );
}
}
/*========================================================================================================*/
void VMLGraphicsPath::SetBrushColor( const std::string& _brushColor )
{
if ( _brushColor.size() == 8 )
{
this->brushColor = _brushColor;
//!!!TODO!!!
this->brushColor.erase( 6, 2 );
}
}
/*========================================================================================================*/
void VMLGraphicsPath::SetWidth( double _width )
{
this->width = _width;
}
/*========================================================================================================*/
void VMLGraphicsPath::SetHeight( double _height )
{
this->height = _height;
}
/*========================================================================================================*/
void VMLGraphicsPath::SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF )
{
this->matrix.SetTransform( _dA, _dB, _dC, _dD, _dE, _dF );
}
/*========================================================================================================*/
void VMLGraphicsPath::ResetTransform()
{
this->matrix.ResetTransform();
}
/*========================================================================================================*/
void VMLGraphicsPath::Close()
{
this->closed = true;
}
/*========================================================================================================*/
void VMLGraphicsPath::MoveTo( double _x, double _y )
{
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLMove( _x, _y ) ) );
}
/*========================================================================================================*/
void VMLGraphicsPath::LineTo( double _x, double _y )
{
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLLine( _x, _y ) ) );
}
/*========================================================================================================*/
void VMLGraphicsPath::LinesTo( const std::vector<double>& _points )
{
size_t pointsSize = _points.size();
if ( ( pointsSize >= 4 ) && ( ( pointsSize % 2 ) == 0 ) )
{
this->MoveTo( _points[0], _points[1] );
for ( unsigned int i = 2; i < ( pointsSize - 1 ); i++ )
{
this->LineTo( _points[i], _points[i + 1] );
}
}
}
/*========================================================================================================*/
void VMLGraphicsPath::CurveTo( double _x1, double _y1, double _x2, double _y2, double _x3, double _y3 )
{
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLCurve( _x1, _y1 ) ) );
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLPoint( _x2, _y2 ) ) );
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLPoint( _x3, _y3 ) ) );
}
/*========================================================================================================*/
void VMLGraphicsPath::CurvesTo( const std::vector<double>& _points )
{
size_t pointsSize = _points.size();
if ( pointsSize >= 8 )
{
this->MoveTo( _points[0], _points[1] );
for ( unsigned int i = 2; i < ( pointsSize - 5 ); ( i += 6 ) )
{
this->CurveTo( _points[i], _points[i + 1], _points[i + 2], _points[i + 3], _points[i + 4], _points[i + 5] );
}
}
}
/*========================================================================================================*/
void VMLGraphicsPath::ArcTo( double _x, double _y, double _width, double _height, double _startAngle, double _sweepAngle )
{
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLArc( ( _x + ( _width / 2 ) ), ( _y + ( _height / 2 ) ) ) ) );
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLPoint( ( _width / 2 ), ( _height / 2 ) ) ) );
this->points.push_back( boost::shared_ptr<VMLPoint>( new VMLAngle( ( ( 0 - _startAngle ) * VMLGraphicsPath::DEGREE_360 / 360 ), ( ( ( 0 - _sweepAngle ) * VMLGraphicsPath::DEGREE_360 / 360 ) ) ) ) );
}
/*========================================================================================================*/
std::vector<std::pair<double, double> > VMLGraphicsPath::GetPathPoints() const
{
std::vector<std::pair<double, double> > pathPoints;
for ( unsigned int i = 0; i < this->points.size(); i++ )
{
pathPoints.push_back( std::make_pair( this->points[i]->GetX(), this->points[i]->GetY() ) );
}
return pathPoints;
}
/*========================================================================================================*/
OOX::Logic::Shape VMLGraphicsPath::GetShape( bool _stroked, bool _filled, unsigned int _resize ) const
{
OOX::Logic::Shape shape;
OOX::Logic::ShapeStyle shapeStyle;
shapeStyle.Position = "absolute";
shapeStyle.PositionHorizontalRelative = "page";
shapeStyle.PositionVerticalRelative = "page";
OOX::Logic::Wrap wrap;
wrap.AnchorX = "page";
wrap.AnchorY = "page";
shape.Style = shapeStyle;
shape.Wrap = wrap;
std::string path;
shape.CoordSize = ( ToString( ceil( this->width ) * _resize ) + "," + ToString( ceil( this->height ) * _resize ) );
UniversalUnit mmX( UniversalUnit::Mm );
UniversalUnit mmY( UniversalUnit::Mm );
mmX = 0;
mmY = 0;
Common::Point<Unit<double, Pt, 0> > point;
point.X = mmX.value( UniversalUnit::Pt );
point.Y = mmY.value( UniversalUnit::Pt );
shape.Style->Point = point;
mmX = this->width;
mmY = this->height;
Common::Size<Unit<double, Pt, 3> > size;
size.Width = mmX.value( UniversalUnit::Pt );
size.Height = mmY.value( UniversalUnit::Pt );
shape.Style->Size = size;
double x = 0;
double y = 0;
for ( unsigned int i = 0; i < this->points.size(); i++ )
{
x = this->points[i]->GetX();
y = this->points[i]->GetY();
this->matrix.AffineTransform( x, y );
if ( typeid(*this->points[i].get()) != typeid(VMLAngle) )
{
x *= _resize;
y *= _resize;
}
boost::scoped_ptr<VMLPoint> newVMLPoint(static_cast<VMLPoint*>(this->points[i]->Clone()));
newVMLPoint->SetPoint( x, y );
path += newVMLPoint->ToString();
}
if ( this->closed )
{
path += "x";
}
if ( _filled )
{
path += "e";
shape.Style->ZIndex = "-999999999";
if ( _stroked )
{
shape.StrokeColor = ( "#" + this->penColor );
shape.StrokeWeight = this->penSize;
}
else
{
shape.StrokeColor = ( "#" + this->brushColor );
UniversalUnit zeroStrokeWeight( UniversalUnit::Pt );
zeroStrokeWeight = 0;
shape.StrokeWeight = zeroStrokeWeight.ToString();
}
shape.FillColor = ( "#" + this->brushColor );
}
else
{
path += "nfe";
shape.Style->ZIndex = "-1";
if ( _stroked )
{
shape.StrokeColor = ( "#" + this->penColor );
shape.StrokeWeight = this->penSize;
}
}
shape.Id = this->id;
shape.Path = path;
return shape;
}
/*========================================================================================================*/
void VMLGraphicsPath::Reset()
{
this->points.clear();
this->closed = false;
}
}
\ No newline at end of file
#pragma once
#include "Docx.h"
#include "TransformationMatrix.h"
#include "Utils.h"
namespace DocxRenderer
{
class VMLGraphicsPath
{
class VMLPoint: public IClone
{
protected:
double x;
double y;
public:
VMLPoint( double _x = 0, double _y = 0 ):
x(_x), y(_y)
{
}
virtual ~VMLPoint()
{
}
virtual IClone* New() const
{
return new VMLPoint();
}
virtual IClone* Clone() const
{
return new VMLPoint( *this );
}
virtual std::string ToString() const
{
return ( "," + ::ToString( ceil( this->x ) ) + "," + ::ToString( ceil( this->y ) ) );
}
virtual double GetX() const
{
return this->x;
}
virtual double GetY() const
{
return this->y;
}
void SetPoint( double _x, double _y )
{
this->x = _x;
this->y = _y;
}
};
class VMLMove: public VMLPoint
{
public:
VMLMove( double _x = 0, double _y = 0 ):
VMLPoint( _x, _y )
{
}
virtual ~VMLMove()
{
}
virtual IClone* New() const
{
return new VMLMove();
}
virtual IClone* Clone() const
{
return new VMLMove( *this );
}
virtual std::string ToString() const
{
return ( "m" + ::ToString( ceil( this->x ) ) + "," + ::ToString( ceil( this->y ) ) );
}
};
class VMLLine: public VMLPoint
{
public:
VMLLine( double _x = 0, double _y = 0 ):
VMLPoint( _x, _y )
{
}
virtual ~VMLLine()
{
}
virtual IClone* New() const
{
return new VMLLine();
}
virtual IClone* Clone() const
{
return new VMLLine( *this );
}
virtual std::string ToString() const
{
return ( "l" + ::ToString( ceil( this->x ) ) + "," + ::ToString( ceil( this->y ) ) );
}
};
class VMLCurve: public VMLPoint
{
public:
VMLCurve( double _x = 0, double _y = 0 ):
VMLPoint( _x, _y )
{
}
virtual ~VMLCurve()
{
}
virtual IClone* New() const
{
return new VMLCurve();
}
virtual IClone* Clone() const
{
return new VMLCurve( *this );
}
virtual std::string ToString() const
{
return ( "c" + ::ToString( ceil( this->x ) ) + "," + ::ToString( ceil( this->y ) ) );
}
};
class VMLArc: public VMLPoint
{
public:
VMLArc( double _x = 0, double _y = 0 ):
VMLPoint( _x, _y )
{
}
virtual ~VMLArc()
{
}
virtual IClone* New() const
{
return new VMLArc();
}
virtual IClone* Clone() const
{
return new VMLArc( *this );
}
virtual std::string ToString() const
{
return ( "al" + ::ToString( ceil( this->x ) ) + "," + ::ToString( ceil( this->y ) ) );
}
};
class VMLAngle: public VMLPoint
{
public:
VMLAngle( double _x = 0, double _y = 0 ):
VMLPoint( _x, _y )
{
}
virtual ~VMLAngle()
{
}
virtual IClone* New() const
{
return new VMLAngle();
}
virtual IClone* Clone() const
{
return new VMLAngle( *this );
}
virtual std::string ToString() const
{
return ( "," + ::ToString( ceil( this->x ) ) + "," + ::ToString( ceil( this->y ) ) );
}
};
private:
std::vector<boost::shared_ptr<VMLPoint> > points;
std::string id;
std::string penSize;
std::string penColor;
std::string brushColor;
double width;
double height;
bool closed;
TransformationMatrix matrix;
//!!!TODO: There is not clearly, how VML save angle values. This is 360 degree approximate value for VML.!!!
static const unsigned long DEGREE_360 = 23592000;
public:
VMLGraphicsPath();
VMLGraphicsPath( const std::string& _id, const std::string& _penSize, const std::string& _penColor );
std::string GetID() const;
void SetID( const std::string& _id );
std::string GetPenSize() const;
void SetPenSize( const std::string& _penSize );
std::string GetPenColor() const;
void SetPenColor( const std::string& _penColor );
void SetBrushColor( const std::string& _brushColor );
void SetWidth( double _width );
void SetHeight( double _height );
void SetTransform( double _dA, double _dB, double _dC, double _dD, double _dE, double _dF );
void ResetTransform();
void Close();
void MoveTo( double _x, double _y );
void LineTo( double _x, double _y );
void LinesTo( const std::vector<double>& _points );
void CurveTo( double _x1, double _y1, double _x2, double _y2, double _x3, double _y3 );
void CurvesTo( const std::vector<double>& _points );
void ArcTo( double _x, double _y, double _width, double _height, double _startAngle, double _sweepAngle );
std::vector<std::pair<double, double> > GetPathPoints() const;
OOX::Logic::Shape GetShape( bool _stroked = true, bool _filled = true, unsigned int _resize = 1000000 ) const;
void Reset();
};
}
\ No newline at end of file
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by ASCOfficeDocxRenderer.rc
//
#define IDS_PROJNAME 100
#define IDR_ASCOFFICEDOCXRENDERER 101
#define IDR_DOCUMENT1 201
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 202
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
#define _APS_NEXT_SYMED_VALUE 102
#endif
#endif
// stdafx.cpp : source file that includes just the standard includes
// AVSOfficeDocxRenderer.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
\ No newline at end of file
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently
#pragma once
#ifndef STRICT
#define STRICT
#endif
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
#endif
#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later.
#endif
#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
#endif
#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
#endif
#define _ATL_APARTMENT_THREADED
#define _ATL_NO_AUTOMATIC_NAMESPACE
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
// turns off ATL's hiding of some common and often safely ignored warning messages
#define _ATL_ALL_WARNINGS
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atltypes.h>
#include <atlctl.h>
#include <atlhost.h>
using namespace ATL;
\ No newline at end of file
#pragma once
//1
//0
//0
//11
#define INTVER 1,0,0,11
#define STRVER "1,0,0,11\0"

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASCOfficeDocxRenderer", "ASCOfficeDocxRenderer\ASCOfficeDocxRenderer2005.vcproj", "{BAB70A60-2DA0-4149-B8FC-99D7007E9BDB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_filesystem", "..\Common\ASCDocxFormat\Projects\boost_filesystem2005.vcproj", "{F6A9ED1C-3D23-4246-9366-41373B2E49C6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boost_system", "..\Common\ASCDocxFormat\Projects\boost_system2005.vcproj", "{3503791E-20B7-41C9-97D9-BAE92596D648}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "..\Common\ASCDocxFormat\Projects\Common2005.vcproj", "{399893AA-3617-4CD8-A980-7F15CDAFA3D2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DocxFormat", "..\Common\ASCDocxFormat\Projects\DocxFormat2005.vcproj", "{A100103A-353E-45E8-A9B8-90B87CC5C0B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Utility", "..\Common\ASCDocxFormat\Projects\Utility2005.vcproj", "{7B9F3647-32D3-4F82-8CA5-A43E490E1457}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XML", "..\Common\ASCDocxFormat\Projects\XML2005.vcproj", "{C1587C15-6268-4451-9263-937E63A945F6}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OfficeSvmFile", "..\ASCImageStudio3\ASCGraphics\OfficeSvmFile\OfficeSvmFile2005.vcproj", "{918D1327-C6ED-43E6-AE22-84A3736F0E87}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BAB70A60-2DA0-4149-B8FC-99D7007E9BDB}.Debug|Win32.ActiveCfg = Debug|Win32
{BAB70A60-2DA0-4149-B8FC-99D7007E9BDB}.Debug|Win32.Build.0 = Debug|Win32
{BAB70A60-2DA0-4149-B8FC-99D7007E9BDB}.Release|Win32.ActiveCfg = Release|Win32
{BAB70A60-2DA0-4149-B8FC-99D7007E9BDB}.Release|Win32.Build.0 = Release|Win32
{F6A9ED1C-3D23-4246-9366-41373B2E49C6}.Debug|Win32.ActiveCfg = Debug|Win32
{F6A9ED1C-3D23-4246-9366-41373B2E49C6}.Debug|Win32.Build.0 = Debug|Win32
{F6A9ED1C-3D23-4246-9366-41373B2E49C6}.Release|Win32.ActiveCfg = Release|Win32
{F6A9ED1C-3D23-4246-9366-41373B2E49C6}.Release|Win32.Build.0 = Release|Win32
{3503791E-20B7-41C9-97D9-BAE92596D648}.Debug|Win32.ActiveCfg = Debug|Win32
{3503791E-20B7-41C9-97D9-BAE92596D648}.Debug|Win32.Build.0 = Debug|Win32
{3503791E-20B7-41C9-97D9-BAE92596D648}.Release|Win32.ActiveCfg = Release|Win32
{3503791E-20B7-41C9-97D9-BAE92596D648}.Release|Win32.Build.0 = Release|Win32
{399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Debug|Win32.ActiveCfg = Debug|Win32
{399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Debug|Win32.Build.0 = Debug|Win32
{399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Release|Win32.ActiveCfg = Release|Win32
{399893AA-3617-4CD8-A980-7F15CDAFA3D2}.Release|Win32.Build.0 = Release|Win32
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.ActiveCfg = Debug|Win32
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Debug|Win32.Build.0 = Debug|Win32
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.ActiveCfg = Release|Win32
{A100103A-353E-45E8-A9B8-90B87CC5C0B0}.Release|Win32.Build.0 = Release|Win32
{7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Debug|Win32.ActiveCfg = Debug|Win32
{7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Debug|Win32.Build.0 = Debug|Win32
{7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Release|Win32.ActiveCfg = Release|Win32
{7B9F3647-32D3-4F82-8CA5-A43E490E1457}.Release|Win32.Build.0 = Release|Win32
{C1587C15-6268-4451-9263-937E63A945F6}.Debug|Win32.ActiveCfg = Debug|Win32
{C1587C15-6268-4451-9263-937E63A945F6}.Debug|Win32.Build.0 = Debug|Win32
{C1587C15-6268-4451-9263-937E63A945F6}.Release|Win32.ActiveCfg = Release|Win32
{C1587C15-6268-4451-9263-937E63A945F6}.Release|Win32.Build.0 = Release|Win32
{918D1327-C6ED-43E6-AE22-84A3736F0E87}.Debug|Win32.ActiveCfg = Debug|Win32
{918D1327-C6ED-43E6-AE22-84A3736F0E87}.Debug|Win32.Build.0 = Debug|Win32
{918D1327-C6ED-43E6-AE22-84A3736F0E87}.Release|Win32.ActiveCfg = Release|Win32
{918D1327-C6ED-43E6-AE22-84A3736F0E87}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
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