Create CPdfReaderContext

This commit is contained in:
Svetlana Kulikova
2025-02-24 15:47:03 +03:00
parent 49a40fa841
commit f28dc0a36a
6 changed files with 184 additions and 159 deletions

View File

@ -341,7 +341,7 @@ bool CPdfFile::LoadFromMemory(BYTE* data, DWORD length, const std::wstring& opti
m_pInternal->pReader = new CPdfReader(m_pInternal->pAppFonts);
if (!m_pInternal->pReader)
return false;
m_pInternal->wsSrcFile = L"";
m_pInternal->wsSrcFile.clear();
m_pInternal->wsPassword = owner_password;
return m_pInternal->pReader->LoadFromMemory(m_pInternal->pAppFonts, data, length, owner_password, user_password) && (m_pInternal->pReader->GetError() == 0);
}
@ -386,6 +386,15 @@ void CPdfFile::GetPageInfo(int nPageIndex, double* pdWidth, double* pdHeight, do
else
m_pInternal->pReader->GetPageInfo(nPageIndex, pdWidth, pdHeight, pdDpiX, pdDpiY);
}
bool CPdfFile::AddPdf(BYTE* data, DWORD length, const std::wstring& wsPassword)
{
m_pInternal->pReader = new CPdfReader(m_pInternal->pAppFonts);
if (!m_pInternal->pReader)
return false;
m_pInternal->wsSrcFile.clear();
m_pInternal->wsPassword = wsPassword;
return m_pInternal->pReader->LoadFromMemory(m_pInternal->pAppFonts, data, length, wsPassword, wsPassword) && (m_pInternal->pReader->GetError() == 0);
}
int CPdfFile::GetRotate(int nPageIndex)
{
if (!m_pInternal->pReader)