Commit 5754306f authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Добавлен класс CPdfRenderer

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63075 954022d7-b5bf-4e40-9824-e11837661b57
parent 2ee5dea6
#include "PdfRenderer.h"
#include "Src/Document.h"
#include "Src/Pages.h"
using namespace PdfWriter;
CPdfRenderer::CPdfRenderer()
{
m_pDocument = new CDocument();
if (!m_pDocument || !m_pDocument->CreateNew())
{
SetError();
return;
}
m_dPageHeight = 297;
m_dPageWidth = 210;
m_pPage = NULL;
}
CPdfRenderer::~CPdfRenderer()
{
if (m_pDocument)
delete m_pDocument;
}
HRESULT CPdfRenderer::get_Type(LONG* lType)
{
*lType = c_nPDFWriter;
}
HRESULT CPdfRenderer::NewPage()
{
if (!IsValid())
return;
m_pPage = m_pDocument->AddPage();
if (!m_pPage)
SetError();
m_pPage->SetWidth(m_dPageWidth);
m_pPage->SetHeight(m_dPageHeight);
}
HRESULT CPdfRenderer::get_Height(double* dHeight)
{
*dHeight = m_dPageHeight;
}
HRESULT CPdfRenderer::put_Height(const double& dHeight)
{
if (!IsValid() || !m_pPage)
return;
m_dPageHeight = dHeight;
m_pPage->SetHeight(dHeight);
}
HRESULT CPdfRenderer::get_Width(double* dWidth)
{
*dWidth = m_dPageWidth;
}
HRESULT CPdfRenderer::put_Width(const double& dWidth)
{
if (!IsValid() || !m_pPage)
return;
m_dPageWidth = dWidth;
m_pPage->SetWidth(dWidth);
}
HRESULT CPdfRenderer::get_DpiX(double* dDpiX)
{
*dDpiX = 72;
}
HRESULT CPdfRenderer::get_DpiY(double* dDpiY)
{
*dDpiY = 72;
}
This diff is collapsed.
......@@ -137,6 +137,7 @@
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="PdfRenderer.cpp" />
<ClCompile Include="Src\Annotation.cpp" />
<ClCompile Include="Src\Catalog.cpp" />
<ClCompile Include="Src\Destination.cpp" />
......@@ -159,6 +160,7 @@
<ClCompile Include="Src\Utils.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="PdfRenderer.h" />
<ClInclude Include="Src\Annotation.h" />
<ClInclude Include="Src\Catalog.h" />
<ClInclude Include="Src\Consts.h" />
......
......@@ -87,6 +87,9 @@
<ClCompile Include="Src\Pattern.cpp">
<Filter>Src\Source Files</Filter>
</ClCompile>
<ClCompile Include="PdfRenderer.cpp">
<Filter>Src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Src\Annotation.h">
......@@ -155,5 +158,8 @@
<ClInclude Include="Src\Pattern.h">
<Filter>Src\Header Files</Filter>
</ClInclude>
<ClInclude Include="PdfRenderer.h">
<Filter>Src</Filter>
</ClInclude>
</ItemGroup>
</Project>
\ No newline at end of file
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