mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
fix another project without Mode
This commit is contained in:
@ -626,7 +626,7 @@ SOURCES += \
|
|||||||
$$PDF_ROOT_DIR/SrcReader/GfxClip.cpp \
|
$$PDF_ROOT_DIR/SrcReader/GfxClip.cpp \
|
||||||
$$PDF_ROOT_DIR/Resources/BaseFonts.cpp \
|
$$PDF_ROOT_DIR/Resources/BaseFonts.cpp \
|
||||||
$$PDF_ROOT_DIR/Resources/CMapMemory/cmap_memory.cpp \
|
$$PDF_ROOT_DIR/Resources/CMapMemory/cmap_memory.cpp \
|
||||||
$$PDF_ROOT_DIR/PdfReader.cpp
|
$$PDF_ROOT_DIR/PdfFile.cpp
|
||||||
|
|
||||||
HEADERS +=\
|
HEADERS +=\
|
||||||
$$PDF_ROOT_DIR/Resources/Fontd050000l.h \
|
$$PDF_ROOT_DIR/Resources/Fontd050000l.h \
|
||||||
@ -649,7 +649,7 @@ HEADERS +=\
|
|||||||
$$PDF_ROOT_DIR/SrcReader/Adaptors.h \
|
$$PDF_ROOT_DIR/SrcReader/Adaptors.h \
|
||||||
$$PDF_ROOT_DIR/SrcReader/MemoryUtils.h \
|
$$PDF_ROOT_DIR/SrcReader/MemoryUtils.h \
|
||||||
$$PDF_ROOT_DIR/SrcReader/GfxClip.h \
|
$$PDF_ROOT_DIR/SrcReader/GfxClip.h \
|
||||||
$$PDF_ROOT_DIR/PdfReader.h
|
$$PDF_ROOT_DIR/PdfFile.h
|
||||||
|
|
||||||
HEADERS += $$CORE_ROOT_DIR/HtmlRenderer/include/HTMLRendererText.h
|
HEADERS += $$CORE_ROOT_DIR/HtmlRenderer/include/HTMLRendererText.h
|
||||||
SOURCES += $$CORE_ROOT_DIR/HtmlRenderer/src/HTMLRendererText.cpp
|
SOURCES += $$CORE_ROOT_DIR/HtmlRenderer/src/HTMLRendererText.cpp
|
||||||
|
|||||||
@ -45,7 +45,7 @@ public:
|
|||||||
{
|
{
|
||||||
nType = _nType;
|
nType = _nType;
|
||||||
if (nType == 0)
|
if (nType == 0)
|
||||||
pReader = new CPdfFile(pApplicationFonts, 1);
|
pReader = new CPdfFile(pApplicationFonts);
|
||||||
else if (nType == 1)
|
else if (nType == 1)
|
||||||
pReader = new CDjVuFile(pApplicationFonts);
|
pReader = new CDjVuFile(pApplicationFonts);
|
||||||
else if (nType == 2)
|
else if (nType == 2)
|
||||||
|
|||||||
@ -236,7 +236,8 @@ void CDjVuFileImplementation::DrawPageOnRenderer(IRenderer* pRenderer, int nPag
|
|||||||
}
|
}
|
||||||
void CDjVuFileImplementation::ConvertToPdf(const std::wstring& wsDstPath)
|
void CDjVuFileImplementation::ConvertToPdf(const std::wstring& wsDstPath)
|
||||||
{
|
{
|
||||||
CPdfFile oPdf(m_pApplicationFonts, 2);
|
CPdfFile oPdf(m_pApplicationFonts);
|
||||||
|
oPdf.CreatePdf();
|
||||||
|
|
||||||
bool bBreak = false;
|
bool bBreak = false;
|
||||||
for (int nPageIndex = 0, nPagesCount = GetPagesCount(); nPageIndex < nPagesCount; nPageIndex++)
|
for (int nPageIndex = 0, nPagesCount = GetPagesCount(); nPageIndex < nPagesCount; nPageIndex++)
|
||||||
|
|||||||
@ -34,21 +34,23 @@
|
|||||||
#include "OnlineOfficeBinToPdf.h"
|
#include "OnlineOfficeBinToPdf.h"
|
||||||
#include "PdfReader.h"
|
#include "PdfReader.h"
|
||||||
|
|
||||||
#include "SrcReader/Adaptors.h"
|
|
||||||
#include "../DesktopEditor/common/File.h"
|
#include "../DesktopEditor/common/File.h"
|
||||||
#include "../DesktopEditor/common/Path.h"
|
#include "../DesktopEditor/common/Path.h"
|
||||||
#include "../DesktopEditor/common/StringExt.h"
|
#include "../DesktopEditor/common/StringExt.h"
|
||||||
|
|
||||||
|
#include "SrcReader/Adaptors.h"
|
||||||
#include "lib/xpdf/PDFDoc.h"
|
#include "lib/xpdf/PDFDoc.h"
|
||||||
#include "lib/xpdf/AcroForm.h"
|
#include "lib/xpdf/AcroForm.h"
|
||||||
#include "lib/xpdf/TextString.h"
|
#include "lib/xpdf/TextString.h"
|
||||||
|
|
||||||
|
#ifndef BUILDING_WASM_MODULE
|
||||||
#include "SrcWriter/Objects.h"
|
#include "SrcWriter/Objects.h"
|
||||||
#include "SrcWriter/Document.h"
|
#include "SrcWriter/Document.h"
|
||||||
#include "SrcWriter/Pages.h"
|
#include "SrcWriter/Pages.h"
|
||||||
#include "SrcWriter/Catalog.h"
|
#include "SrcWriter/Catalog.h"
|
||||||
#include "SrcWriter/EncryptDictionary.h"
|
#include "SrcWriter/EncryptDictionary.h"
|
||||||
#include "SrcWriter/Info.h"
|
#include "SrcWriter/Info.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define AddToObject(oVal)\
|
#define AddToObject(oVal)\
|
||||||
{\
|
{\
|
||||||
@ -161,6 +163,7 @@ class CPdfFile_Private
|
|||||||
public:
|
public:
|
||||||
std::wstring wsSrcFile;
|
std::wstring wsSrcFile;
|
||||||
std::wstring wsPassword;
|
std::wstring wsPassword;
|
||||||
|
std::wstring wsTempFolder;
|
||||||
NSFonts::IApplicationFonts* pAppFonts;
|
NSFonts::IApplicationFonts* pAppFonts;
|
||||||
|
|
||||||
CPdfReader* pReader;
|
CPdfReader* pReader;
|
||||||
@ -239,27 +242,13 @@ public:
|
|||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
CPdfFile::CPdfFile(NSFonts::IApplicationFonts* pAppFonts, bool isPDFA)
|
CPdfFile::CPdfFile(NSFonts::IApplicationFonts* pAppFonts)
|
||||||
{
|
{
|
||||||
m_pInternal = new CPdfFile_Private();
|
m_pInternal = new CPdfFile_Private();
|
||||||
|
|
||||||
m_pInternal->pAppFonts = pAppFonts;
|
m_pInternal->pAppFonts = pAppFonts;
|
||||||
m_pInternal->pWriter = new CPdfWriter(m_pInternal->pAppFonts, isPDFA);
|
m_pInternal->pWriter = NULL;
|
||||||
m_pInternal->pReader = new CPdfReader(m_pInternal->pAppFonts);
|
m_pInternal->pReader = NULL;
|
||||||
m_pInternal->wsPassword = L"";
|
|
||||||
m_pInternal->bEdit = false;
|
|
||||||
m_pInternal->bEditPage = false;
|
|
||||||
}
|
|
||||||
// nMode = 1/2/3, 01 - reader, 10 - writer, 11 - editer
|
|
||||||
CPdfFile::CPdfFile(NSFonts::IApplicationFonts* pAppFonts, int nMode, bool isPDFA)
|
|
||||||
{
|
|
||||||
m_pInternal = new CPdfFile_Private();
|
|
||||||
|
|
||||||
m_pInternal->pAppFonts = pAppFonts;
|
|
||||||
if (nMode & 1)
|
|
||||||
m_pInternal->pReader = new CPdfReader(m_pInternal->pAppFonts);
|
|
||||||
if (nMode & 2)
|
|
||||||
m_pInternal->pWriter = new CPdfWriter(m_pInternal->pAppFonts, isPDFA);
|
|
||||||
m_pInternal->wsPassword = L"";
|
m_pInternal->wsPassword = L"";
|
||||||
m_pInternal->bEdit = false;
|
m_pInternal->bEdit = false;
|
||||||
m_pInternal->bEditPage = false;
|
m_pInternal->bEditPage = false;
|
||||||
@ -269,13 +258,6 @@ CPdfFile::~CPdfFile()
|
|||||||
RELEASEOBJECT(m_pInternal->pWriter);
|
RELEASEOBJECT(m_pInternal->pWriter);
|
||||||
RELEASEOBJECT(m_pInternal->pReader);
|
RELEASEOBJECT(m_pInternal->pReader);
|
||||||
}
|
}
|
||||||
void CPdfFile::SetTemp(const std::wstring& wsPath)
|
|
||||||
{
|
|
||||||
if (m_pInternal->pWriter)
|
|
||||||
m_pInternal->pWriter->SetTempFolder (wsPath);
|
|
||||||
if (m_pInternal->pReader)
|
|
||||||
m_pInternal->pReader->SetTempDirectory(wsPath);
|
|
||||||
}
|
|
||||||
NSFonts::IFontManager* CPdfFile::GetFontManager()
|
NSFonts::IFontManager* CPdfFile::GetFontManager()
|
||||||
{
|
{
|
||||||
if (!m_pInternal->pReader)
|
if (!m_pInternal->pReader)
|
||||||
@ -455,24 +437,30 @@ bool CPdfFile::EditPdf(const std::wstring& wsDstFile)
|
|||||||
pagesRefObj.free();
|
pagesRefObj.free();
|
||||||
return bRes;
|
return bRes;
|
||||||
}
|
}
|
||||||
bool CPdfFile::EditClose()
|
void CPdfFile::Close()
|
||||||
{
|
{
|
||||||
|
if (!m_pInternal->bEdit)
|
||||||
|
{
|
||||||
|
if (m_pInternal->pReader)
|
||||||
|
m_pInternal->pReader->Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!m_pInternal->pWriter || !m_pInternal->pReader)
|
if (!m_pInternal->pWriter || !m_pInternal->pReader)
|
||||||
return false;
|
return;
|
||||||
PDFDoc* pPDFDocument = m_pInternal->pReader->GetPDFDocument();
|
PDFDoc* pPDFDocument = m_pInternal->pReader->GetPDFDocument();
|
||||||
PdfWriter::CDocument* pDoc = m_pInternal->pWriter->m_pDocument;
|
PdfWriter::CDocument* pDoc = m_pInternal->pWriter->m_pDocument;
|
||||||
if (!pPDFDocument || !pDoc || !m_pInternal->bEdit)
|
if (!pPDFDocument || !pDoc)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
XRef* xref = pPDFDocument->getXRef();
|
XRef* xref = pPDFDocument->getXRef();
|
||||||
if (!xref)
|
if (!xref)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
// Добавляем первый элемент в таблицу xref
|
// Добавляем первый элемент в таблицу xref
|
||||||
// он должен иметь вид 0000000000 65535 f
|
// он должен иметь вид 0000000000 65535 f
|
||||||
PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, 0, 65535);
|
PdfWriter::CXref* pXref = new PdfWriter::CXref(pDoc, 0, 65535);
|
||||||
if (!pXref)
|
if (!pXref)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
PdfWriter::CDictObject* pTrailer = NULL;
|
PdfWriter::CDictObject* pTrailer = NULL;
|
||||||
Object* trailerDict = xref->getTrailerDict();
|
Object* trailerDict = xref->getTrailerDict();
|
||||||
@ -500,12 +488,12 @@ bool CPdfFile::EditClose()
|
|||||||
PdfWriter::CObjectBase* pInfo = pTrailer->Get("Info");
|
PdfWriter::CObjectBase* pInfo = pTrailer->Get("Info");
|
||||||
pInfoXref = new PdfWriter::CXref(pDoc, pInfo ? pInfo->GetObjId() : 0);
|
pInfoXref = new PdfWriter::CXref(pDoc, pInfo ? pInfo->GetObjId() : 0);
|
||||||
if (!pInfoXref)
|
if (!pInfoXref)
|
||||||
return false;
|
return;
|
||||||
pInfoDict = new PdfWriter::CInfoDict(pInfoXref);
|
pInfoDict = new PdfWriter::CInfoDict(pInfoXref);
|
||||||
if (!pInfoDict)
|
if (!pInfoDict)
|
||||||
{
|
{
|
||||||
RELEASEOBJECT(pInfoXref);
|
RELEASEOBJECT(pInfoXref);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int nIndex = 0; nIndex < info.dictGetLength(); ++nIndex)
|
for (int nIndex = 0; nIndex < info.dictGetLength(); ++nIndex)
|
||||||
@ -526,10 +514,10 @@ bool CPdfFile::EditClose()
|
|||||||
|
|
||||||
bool bRes = m_pInternal->pWriter->EditClose();
|
bool bRes = m_pInternal->pWriter->EditClose();
|
||||||
if (!bRes)
|
if (!bRes)
|
||||||
return false;
|
return;
|
||||||
bRes = pDoc->AddToFile(pXref, pTrailer, pInfoXref, pInfoDict);
|
bRes = pDoc->AddToFile(pXref, pTrailer, pInfoXref, pInfoDict);
|
||||||
if (!bRes)
|
if (!bRes)
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
std::wstring wsPath = pDoc->GetEditPdfPath();
|
std::wstring wsPath = pDoc->GetEditPdfPath();
|
||||||
std::string sPathUtf8New = U_TO_UTF8(wsPath);
|
std::string sPathUtf8New = U_TO_UTF8(wsPath);
|
||||||
@ -552,7 +540,6 @@ bool CPdfFile::EditClose()
|
|||||||
|
|
||||||
m_pInternal->bEdit = false;
|
m_pInternal->bEdit = false;
|
||||||
m_pInternal->bEditPage = false;
|
m_pInternal->bEditPage = false;
|
||||||
return bRes;
|
|
||||||
}
|
}
|
||||||
bool CPdfFile::EditPage(int nPageIndex)
|
bool CPdfFile::EditPage(int nPageIndex)
|
||||||
{
|
{
|
||||||
@ -669,26 +656,26 @@ int CPdfFile::GetError()
|
|||||||
|
|
||||||
bool CPdfFile::LoadFromFile(const std::wstring& file, const std::wstring& options, const std::wstring& owner_password, const std::wstring& user_password)
|
bool CPdfFile::LoadFromFile(const std::wstring& file, const std::wstring& options, const std::wstring& owner_password, const std::wstring& user_password)
|
||||||
{
|
{
|
||||||
|
m_pInternal->pReader = new CPdfReader(m_pInternal->pAppFonts);
|
||||||
if (!m_pInternal->pReader)
|
if (!m_pInternal->pReader)
|
||||||
return false;
|
return false;
|
||||||
m_pInternal->wsSrcFile = file;
|
m_pInternal->wsSrcFile = file;
|
||||||
m_pInternal->wsPassword = owner_password;
|
m_pInternal->wsPassword = owner_password;
|
||||||
|
if (!m_pInternal->wsTempFolder.empty())
|
||||||
|
m_pInternal->pReader->SetTempDirectory(m_pInternal->wsTempFolder);
|
||||||
return m_pInternal->pReader->LoadFromFile(m_pInternal->pAppFonts, file, owner_password, user_password) && (m_pInternal->pReader->GetError() == 0);
|
return m_pInternal->pReader->LoadFromFile(m_pInternal->pAppFonts, file, owner_password, user_password) && (m_pInternal->pReader->GetError() == 0);
|
||||||
}
|
}
|
||||||
bool CPdfFile::LoadFromMemory(BYTE* data, DWORD length, const std::wstring& options, const std::wstring& owner_password, const std::wstring& user_password)
|
bool CPdfFile::LoadFromMemory(BYTE* data, DWORD length, const std::wstring& options, const std::wstring& owner_password, const std::wstring& user_password)
|
||||||
{
|
{
|
||||||
|
m_pInternal->pReader = new CPdfReader(m_pInternal->pAppFonts);
|
||||||
if (!m_pInternal->pReader)
|
if (!m_pInternal->pReader)
|
||||||
return false;
|
return false;
|
||||||
m_pInternal->wsSrcFile = L"";
|
m_pInternal->wsSrcFile = L"";
|
||||||
m_pInternal->wsPassword = owner_password;
|
m_pInternal->wsPassword = owner_password;
|
||||||
|
if (!m_pInternal->wsTempFolder.empty())
|
||||||
|
m_pInternal->pReader->SetTempDirectory(m_pInternal->wsTempFolder);
|
||||||
return m_pInternal->pReader->LoadFromMemory(m_pInternal->pAppFonts, data, length, owner_password, user_password) && (m_pInternal->pReader->GetError() == 0);
|
return m_pInternal->pReader->LoadFromMemory(m_pInternal->pAppFonts, data, length, owner_password, user_password) && (m_pInternal->pReader->GetError() == 0);
|
||||||
}
|
}
|
||||||
void CPdfFile::Close()
|
|
||||||
{
|
|
||||||
if (!m_pInternal->pReader)
|
|
||||||
return;
|
|
||||||
m_pInternal->pReader->Close();
|
|
||||||
}
|
|
||||||
NSFonts::IApplicationFonts* CPdfFile::GetFonts()
|
NSFonts::IApplicationFonts* CPdfFile::GetFonts()
|
||||||
{
|
{
|
||||||
return m_pInternal->pAppFonts;
|
return m_pInternal->pAppFonts;
|
||||||
@ -703,11 +690,13 @@ std::wstring CPdfFile::GetTempDirectory()
|
|||||||
return std::wstring();
|
return std::wstring();
|
||||||
return m_pInternal->pReader->GetTempDirectory();
|
return m_pInternal->pReader->GetTempDirectory();
|
||||||
}
|
}
|
||||||
void CPdfFile::SetTempDirectory(const std::wstring& directory)
|
void CPdfFile::SetTempDirectory(const std::wstring& wsPath)
|
||||||
{
|
{
|
||||||
if (!m_pInternal->pReader)
|
m_pInternal->wsTempFolder = wsPath;
|
||||||
return;
|
if (m_pInternal->pReader)
|
||||||
m_pInternal->pReader->SetTempDirectory(directory);
|
m_pInternal->pReader->SetTempDirectory(wsPath);
|
||||||
|
if (m_pInternal->pWriter)
|
||||||
|
m_pInternal->pWriter->SetTempFolder(wsPath);
|
||||||
}
|
}
|
||||||
int CPdfFile::GetPagesCount()
|
int CPdfFile::GetPagesCount()
|
||||||
{
|
{
|
||||||
@ -749,6 +738,12 @@ BYTE* CPdfFile::GetLinks(int nPageIndex)
|
|||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void CPdfFile::CreatePdf(bool isPDFA)
|
||||||
|
{
|
||||||
|
m_pInternal->pWriter = new CPdfWriter(m_pInternal->pAppFonts, isPDFA);
|
||||||
|
if (!m_pInternal->wsTempFolder.empty())
|
||||||
|
m_pInternal->pWriter->SetTempFolder(m_pInternal->wsTempFolder);
|
||||||
|
}
|
||||||
int CPdfFile::SaveToFile(const std::wstring& wsPath)
|
int CPdfFile::SaveToFile(const std::wstring& wsPath)
|
||||||
{
|
{
|
||||||
if (!m_pInternal->pWriter)
|
if (!m_pInternal->pWriter)
|
||||||
@ -767,12 +762,6 @@ void CPdfFile::SetDocumentID(const std::wstring& wsDocumentID)
|
|||||||
return;
|
return;
|
||||||
m_pInternal->pWriter->SetDocumentID(wsDocumentID);
|
m_pInternal->pWriter->SetDocumentID(wsDocumentID);
|
||||||
}
|
}
|
||||||
void CPdfFile::SetTempFolder(const std::wstring& wsPath)
|
|
||||||
{
|
|
||||||
if (!m_pInternal->pWriter)
|
|
||||||
return;
|
|
||||||
m_pInternal->pWriter->SetTempFolder(wsPath);
|
|
||||||
}
|
|
||||||
void CPdfFile::SetCore(const std::wstring& wsCoreXml)
|
void CPdfFile::SetCore(const std::wstring& wsCoreXml)
|
||||||
{
|
{
|
||||||
if (!m_pInternal->pWriter)
|
if (!m_pInternal->pWriter)
|
||||||
@ -1415,16 +1404,13 @@ int CPdfWriter::SaveToFile(const std::wstring& wsPath) { return 0; }
|
|||||||
void CPdfWriter::SetPassword(const std::wstring& wsPassword) {}
|
void CPdfWriter::SetPassword(const std::wstring& wsPassword) {}
|
||||||
void CPdfWriter::SetDocumentID(const std::wstring& wsDocumentID) {}
|
void CPdfWriter::SetDocumentID(const std::wstring& wsDocumentID) {}
|
||||||
void CPdfWriter::SetTempFolder(const std::wstring& wsPath) {}
|
void CPdfWriter::SetTempFolder(const std::wstring& wsPath) {}
|
||||||
std::wstring CPdfWriter::GetTempDirectory() { return std::wstring(); }
|
void CPdfWriter::SetCore(const std::wstring& wsCore) {}
|
||||||
std::wstring CPdfWriter::GetTempFile() { return std::wstring(); }
|
std::wstring CPdfWriter::GetTempFile() { return std::wstring(); }
|
||||||
HRESULT CPdfWriter::get_Type(LONG* lType) { return 0; }
|
|
||||||
HRESULT CPdfWriter::NewPage() { return 0; }
|
HRESULT CPdfWriter::NewPage() { return 0; }
|
||||||
HRESULT CPdfWriter::get_Height(double* dHeight) { return 0; }
|
HRESULT CPdfWriter::get_Height(double* dHeight) { return 0; }
|
||||||
HRESULT CPdfWriter::put_Height(const double& dHeight) { return 0; }
|
HRESULT CPdfWriter::put_Height(const double& dHeight) { return 0; }
|
||||||
HRESULT CPdfWriter::get_Width(double* dWidth) { return 0; }
|
HRESULT CPdfWriter::get_Width(double* dWidth) { return 0; }
|
||||||
HRESULT CPdfWriter::put_Width(const double& dWidth) { return 0; }
|
HRESULT CPdfWriter::put_Width(const double& dWidth) { return 0; }
|
||||||
HRESULT CPdfWriter::get_DpiX(double* dDpiX) { return 0; }
|
|
||||||
HRESULT CPdfWriter::get_DpiY(double* dDpiY) { return 0; }
|
|
||||||
HRESULT CPdfWriter::get_PenColor(LONG* lColor) { return 0; }
|
HRESULT CPdfWriter::get_PenColor(LONG* lColor) { return 0; }
|
||||||
HRESULT CPdfWriter::put_PenColor(const LONG& lColor) { return 0; }
|
HRESULT CPdfWriter::put_PenColor(const LONG& lColor) { return 0; }
|
||||||
HRESULT CPdfWriter::get_PenAlpha(LONG* lAlpha) { return 0; }
|
HRESULT CPdfWriter::get_PenAlpha(LONG* lAlpha) { return 0; }
|
||||||
@ -1465,7 +1451,6 @@ HRESULT CPdfWriter::put_BrushTextureAlpha(const LONG& lAlpha) { return 0; }
|
|||||||
HRESULT CPdfWriter::get_BrushLinearAngle(double* dAngle) { return 0; }
|
HRESULT CPdfWriter::get_BrushLinearAngle(double* dAngle) { return 0; }
|
||||||
HRESULT CPdfWriter::put_BrushLinearAngle(const double& dAngle) { return 0; }
|
HRESULT CPdfWriter::put_BrushLinearAngle(const double& dAngle) { return 0; }
|
||||||
HRESULT CPdfWriter::BrushRect(const INT& nVal, const double& dLeft, const double& dTop, const double& dWidth, const double& dHeight) { return 0; }
|
HRESULT CPdfWriter::BrushRect(const INT& nVal, const double& dLeft, const double& dTop, const double& dWidth, const double& dHeight) { return 0; }
|
||||||
HRESULT CPdfWriter::BrushBounds(const double& dLeft, const double& dTop, const double& dWidth, const double& dHeight) { return 0; }
|
|
||||||
HRESULT CPdfWriter::put_BrushGradientColors(LONG* pColors, double* pPositions, LONG lCount) { return 0; }
|
HRESULT CPdfWriter::put_BrushGradientColors(LONG* pColors, double* pPositions, LONG lCount) { return 0; }
|
||||||
HRESULT CPdfWriter::get_FontName(std::wstring* wsName) { return 0; }
|
HRESULT CPdfWriter::get_FontName(std::wstring* wsName) { return 0; }
|
||||||
HRESULT CPdfWriter::put_FontName(const std::wstring& wsName) { return 0; }
|
HRESULT CPdfWriter::put_FontName(const std::wstring& wsName) { return 0; }
|
||||||
@ -1486,8 +1471,7 @@ HRESULT CPdfWriter::CommandDrawTextExCHAR(const LONG& lUnicode, const LONG& lGid
|
|||||||
HRESULT CPdfWriter::CommandDrawText (const std::wstring& wsUnicodeText, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
HRESULT CPdfWriter::CommandDrawText (const std::wstring& wsUnicodeText, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
||||||
HRESULT CPdfWriter::CommandDrawTextEx (const std::wstring& wsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
HRESULT CPdfWriter::CommandDrawTextEx (const std::wstring& wsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
||||||
HRESULT CPdfWriter::CommandDrawTextCHAR2 (unsigned int* unUnicode, const unsigned int& unUnicodeCount, const unsigned int& unGid, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
HRESULT CPdfWriter::CommandDrawTextCHAR2 (unsigned int* unUnicode, const unsigned int& unUnicodeCount, const unsigned int& unGid, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
||||||
HRESULT CPdfWriter::BeginCommand(const DWORD& lType) { return 0; }
|
HRESULT CPdfWriter::EndCommand(const DWORD& lType, const LONG& lClipMode) { return 0; }
|
||||||
HRESULT CPdfWriter::EndCommand(const DWORD& lType) { return 0; }
|
|
||||||
HRESULT CPdfWriter::PathCommandMoveTo(const double& dX, const double& dY) { return 0; }
|
HRESULT CPdfWriter::PathCommandMoveTo(const double& dX, const double& dY) { return 0; }
|
||||||
HRESULT CPdfWriter::PathCommandLineTo(const double& dX, const double& dY) { return 0; }
|
HRESULT CPdfWriter::PathCommandLineTo(const double& dX, const double& dY) { return 0; }
|
||||||
HRESULT CPdfWriter::PathCommandLinesTo(double* pPoints, const int& nCount) { return 0; }
|
HRESULT CPdfWriter::PathCommandLinesTo(double* pPoints, const int& nCount) { return 0; }
|
||||||
@ -1508,30 +1492,19 @@ HRESULT CPdfWriter::DrawImageFromFile(NSFonts::IApplicationFonts* pAppFonts, con
|
|||||||
HRESULT CPdfWriter::SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) { return 0; }
|
HRESULT CPdfWriter::SetTransform(const double& dM11, const double& dM12, const double& dM21, const double& dM22, const double& dX, const double& dY) { return 0; }
|
||||||
HRESULT CPdfWriter::GetTransform(double* dM11, double* dM12, double* dM21, double* dM22, double* dX, double* dY) { return 0; }
|
HRESULT CPdfWriter::GetTransform(double* dM11, double* dM12, double* dM21, double* dM22, double* dX, double* dY) { return 0; }
|
||||||
HRESULT CPdfWriter::ResetTransform() { return 0; }
|
HRESULT CPdfWriter::ResetTransform() { return 0; }
|
||||||
HRESULT CPdfWriter::get_ClipMode(LONG* lMode) { return 0; }
|
|
||||||
HRESULT CPdfWriter::put_ClipMode(const LONG& lMode) { return 0; }
|
|
||||||
HRESULT CPdfWriter::CommandLong(const LONG& lType, const LONG& lCommand) { return 0; }
|
|
||||||
HRESULT CPdfWriter::CommandDouble(const LONG& lType, const double& dCommand) { return 0; }
|
|
||||||
HRESULT CPdfWriter::CommandString(const LONG& lType, const std::wstring& sCommand) { return 0; }
|
|
||||||
HRESULT CPdfWriter::AddHyperlink(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsUrl, const std::wstring& wsTooltip) { return 0; }
|
HRESULT CPdfWriter::AddHyperlink(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsUrl, const std::wstring& wsTooltip) { return 0; }
|
||||||
HRESULT CPdfWriter::AddLink(const double& dX, const double& dY, const double& dW, const double& dH, const double& dDestX, const double& dDestY, const int& nPage) { return 0; }
|
HRESULT CPdfWriter::AddLink(const double& dX, const double& dY, const double& dW, const double& dH, const double& dDestX, const double& dDestY, const int& nPage) { return 0; }
|
||||||
HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, IFormField* pInfo) { return 0; }
|
HRESULT CPdfWriter::AddFormField(NSFonts::IApplicationFonts* pAppFonts, IFormField* pInfo) { return 0; }
|
||||||
HRESULT CPdfWriter::CommandDrawTextPdf(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const std::wstring& wsSrcCodeText, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
|
||||||
HRESULT CPdfWriter::PathCommandTextPdf(const std::wstring& bsUnicodeText, const unsigned int* pGids, const unsigned int nGidsCount, const std::wstring& bsSrcCodeText, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
|
||||||
HRESULT CPdfWriter::DrawImage1bpp(NSImages::CPixJbig2* pImageBuffer, const unsigned int& unWidth, const unsigned int& unHeight, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
HRESULT CPdfWriter::DrawImage1bpp(NSImages::CPixJbig2* pImageBuffer, const unsigned int& unWidth, const unsigned int& unHeight, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
||||||
HRESULT CPdfWriter::EnableBrushRect(const LONG& lEnable) { return 0; }
|
HRESULT CPdfWriter::EnableBrushRect(const LONG& lEnable) { return 0; }
|
||||||
HRESULT CPdfWriter::SetLinearGradient(const double& dX1, const double& dY1, const double& dX2, const double& dY2) { return 0; }
|
HRESULT CPdfWriter::SetLinearGradient(const double& dX1, const double& dY1, const double& dX2, const double& dY2) { return 0; }
|
||||||
HRESULT CPdfWriter::SetRadialGradient(const double& dX1, const double& dY1, const double& dR1, const double& dX2, const double& dY2, const double& dR2) { return 0; }
|
HRESULT CPdfWriter::SetRadialGradient(const double& dX1, const double& dY1, const double& dR1, const double& dX2, const double& dY2, const double& dR2) { return 0; }
|
||||||
HRESULT CPdfWriter::DrawImageWith1bppMask(IGrObject* pImage, NSImages::CPixJbig2* pMaskBuffer, const unsigned int& unMaskWidth, const unsigned int& unMaskHeight, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
HRESULT CPdfWriter::DrawImageWith1bppMask(IGrObject* pImage, NSImages::CPixJbig2* pMaskBuffer, const unsigned int& unMaskWidth, const unsigned int& unMaskHeight, const double& dX, const double& dY, const double& dW, const double& dH) { return 0; }
|
||||||
std::pair<int, int> CPdfWriter::GetPageRef(int nPageIndex) { return std::make_pair(0, 0); }
|
|
||||||
bool CPdfWriter::EditPage(PdfWriter::CPage* pNewPage) { return false; }
|
bool CPdfWriter::EditPage(PdfWriter::CPage* pNewPage) { return false; }
|
||||||
bool CPdfWriter::AddPage(int nPageIndex) { return false; }
|
bool CPdfWriter::AddPage(int nPageIndex) { return false; }
|
||||||
bool CPdfWriter::DeletePage(int nPageIndex) { return false; }
|
|
||||||
bool CPdfWriter::EditClose() { return false; }
|
bool CPdfWriter::EditClose() { return false; }
|
||||||
void CPdfWriter::PageRotate(int nRotate) {}
|
void CPdfWriter::PageRotate(int nRotate) {}
|
||||||
void CPdfWriter::Sign(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsPicturePath, ICertificate* pCertificate) {}
|
void CPdfWriter::Sign(const double& dX, const double& dY, const double& dW, const double& dH, const std::wstring& wsPicturePath, ICertificate* pCertificate) {}
|
||||||
std::wstring CPdfWriter::GetEditPdfPath() { return std::wstring(); }
|
|
||||||
PdfWriter::CImageDict* CPdfWriter::LoadImage(Aggplus::CImage* pImage, const BYTE& nAlpha) { return NULL; }
|
|
||||||
bool CPdfWriter::DrawImage(Aggplus::CImage* pImage, const double& dX, const double& dY, const double& dW, const double& dH, const BYTE& nAlpha) { return false; }
|
bool CPdfWriter::DrawImage(Aggplus::CImage* pImage, const double& dX, const double& dY, const double& dW, const double& dH, const BYTE& nAlpha) { return false; }
|
||||||
bool CPdfWriter::DrawText(unsigned char* pCodes, const unsigned int& unLen, const double& dX, const double& dY) { return false; }
|
bool CPdfWriter::DrawText(unsigned char* pCodes, const unsigned int& unLen, const double& dX, const double& dY) { return false; }
|
||||||
bool CPdfWriter::PathCommandDrawText(unsigned int* pUnicodes, unsigned int unLen, const double& dX, const double& dY, const unsigned int* pGids) { return false; }
|
bool CPdfWriter::PathCommandDrawText(unsigned int* pUnicodes, unsigned int unLen, const double& dX, const double& dY, const unsigned int* pGids) { return false; }
|
||||||
@ -1553,10 +1526,8 @@ std::wstring CPdfWriter::GetDownloadFile(const std::wstring& sUrl) { return std:
|
|||||||
|
|
||||||
CPdfWriter::CCommandManager::CCommandManager(CPdfWriter* pRenderer) {}
|
CPdfWriter::CCommandManager::CCommandManager(CPdfWriter* pRenderer) {}
|
||||||
CPdfWriter::CCommandManager::~CCommandManager() {}
|
CPdfWriter::CCommandManager::~CCommandManager() {}
|
||||||
CRendererTextCommand* CPdfWriter::CCommandManager::AddText(unsigned char* pCodes, unsigned int nLen, const double& dX, const double& dY) {}
|
CRendererTextCommand* CPdfWriter::CCommandManager::AddText(unsigned char* pCodes, unsigned int nLen, const double& dX, const double& dY) { return NULL; }
|
||||||
void CPdfWriter::CCommandManager::Flush() {}
|
void CPdfWriter::CCommandManager::Flush() {}
|
||||||
void CPdfWriter::CCommandManager::SetTransform(const CTransform& oTransform) {}
|
|
||||||
void CPdfWriter::CCommandManager::SetTransform(const double& m11, const double& m12, const double& m21, const double& m22, const double& dx, const double& dy) {}
|
|
||||||
void CPdfWriter::CCommandManager::Add(CRendererCommandBase* pCommand) {}
|
void CPdfWriter::CCommandManager::Add(CRendererCommandBase* pCommand) {}
|
||||||
void CPdfWriter::CCommandManager::Clear() {}
|
void CPdfWriter::CCommandManager::Clear() {}
|
||||||
void CPdfWriter::CBrushState::Reset() {}
|
void CPdfWriter::CBrushState::Reset() {}
|
||||||
|
|||||||
@ -82,16 +82,14 @@ namespace PdfFile
|
|||||||
class PDFFILE_DECL_EXPORT CPdfFile : public IOfficeDrawingFile, public IRenderer
|
class PDFFILE_DECL_EXPORT CPdfFile : public IOfficeDrawingFile, public IRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CPdfFile(NSFonts::IApplicationFonts* pAppFonts, bool isPDFA = false);
|
CPdfFile(NSFonts::IApplicationFonts* pAppFonts);
|
||||||
// nMode = 1/2/3, 1 - reader, 2 - writer, 3 - editer
|
|
||||||
CPdfFile(NSFonts::IApplicationFonts* pAppFonts, int nMode, bool isPDFA = false);
|
|
||||||
virtual ~CPdfFile();
|
virtual ~CPdfFile();
|
||||||
|
|
||||||
void SetTemp(const std::wstring& wsPath);
|
|
||||||
NSFonts::IFontManager* GetFontManager();
|
NSFonts::IFontManager* GetFontManager();
|
||||||
|
|
||||||
|
// --- EDIT ---
|
||||||
|
|
||||||
bool EditPdf(const std::wstring& wsDstFile = L"");
|
bool EditPdf(const std::wstring& wsDstFile = L"");
|
||||||
bool EditClose();
|
virtual void Close();
|
||||||
bool EditPage (int nPageIndex);
|
bool EditPage (int nPageIndex);
|
||||||
bool DeletePage(int nPageIndex);
|
bool DeletePage(int nPageIndex);
|
||||||
bool AddPage (int nPageIndex);
|
bool AddPage (int nPageIndex);
|
||||||
@ -102,18 +100,14 @@ public:
|
|||||||
|
|
||||||
int GetError();
|
int GetError();
|
||||||
|
|
||||||
|
|
||||||
virtual bool LoadFromFile (const std::wstring& file, const std::wstring& options = L"", const std::wstring& owner_password = L"", const std::wstring& user_password = L"");
|
virtual bool LoadFromFile (const std::wstring& file, const std::wstring& options = L"", const std::wstring& owner_password = L"", const std::wstring& user_password = L"");
|
||||||
virtual bool LoadFromMemory(BYTE* data, DWORD length, const std::wstring& options = L"", const std::wstring& owner_password = L"", const std::wstring& user_password = L"");
|
virtual bool LoadFromMemory(BYTE* data, DWORD length, const std::wstring& options = L"", const std::wstring& owner_password = L"", const std::wstring& user_password = L"");
|
||||||
|
|
||||||
virtual void Close();
|
|
||||||
|
|
||||||
virtual NSFonts::IApplicationFonts* GetFonts();
|
virtual NSFonts::IApplicationFonts* GetFonts();
|
||||||
|
|
||||||
virtual OfficeDrawingFileType GetType();
|
virtual OfficeDrawingFileType GetType();
|
||||||
|
|
||||||
virtual std::wstring GetTempDirectory();
|
virtual std::wstring GetTempDirectory();
|
||||||
virtual void SetTempDirectory(const std::wstring& directory);
|
virtual void SetTempDirectory(const std::wstring& wsPath);
|
||||||
|
|
||||||
virtual int GetPagesCount();
|
virtual int GetPagesCount();
|
||||||
virtual void GetPageInfo(int nPageIndex, double* pdWidth, double* pdHeight, double* pdDpiX, double* pdDpiY);
|
virtual void GetPageInfo(int nPageIndex, double* pdWidth, double* pdHeight, double* pdDpiX, double* pdDpiY);
|
||||||
@ -124,10 +118,10 @@ public:
|
|||||||
|
|
||||||
// --- WRITER ---
|
// --- WRITER ---
|
||||||
|
|
||||||
|
void CreatePdf (bool isPDFA = false);
|
||||||
int SaveToFile (const std::wstring& wsPath);
|
int SaveToFile (const std::wstring& wsPath);
|
||||||
void SetPassword (const std::wstring& wsPassword);
|
void SetPassword (const std::wstring& wsPassword);
|
||||||
void SetDocumentID(const std::wstring& wsDocumentID);
|
void SetDocumentID(const std::wstring& wsDocumentID);
|
||||||
void SetTempFolder(const std::wstring& wsPath);
|
|
||||||
void SetCore (const std::wstring& wsCoreXml);
|
void SetCore (const std::wstring& wsCoreXml);
|
||||||
HRESULT OnlineWordToPdf (const std::wstring& wsSrcFile, const std::wstring& wsDstFile, CConvertFromBinParams* pParams = NULL);
|
HRESULT OnlineWordToPdf (const std::wstring& wsSrcFile, const std::wstring& wsDstFile, CConvertFromBinParams* pParams = NULL);
|
||||||
HRESULT OnlineWordToPdfFromBinary(const std::wstring& wsSrcFile, const std::wstring& wsDstFile, CConvertFromBinParams* pParams = NULL);
|
HRESULT OnlineWordToPdfFromBinary(const std::wstring& wsSrcFile, const std::wstring& wsDstFile, CConvertFromBinParams* pParams = NULL);
|
||||||
|
|||||||
@ -4826,7 +4826,7 @@ namespace PdfReader
|
|||||||
m_pRenderer->EndConvertCoordsToIdentity();
|
m_pRenderer->EndConvertCoordsToIdentity();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_sClip[i].GetPathNum() > 0 && !m_sClip[i].GetTextClip())
|
if (m_sClip[i].GetPathNum() > 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ int main()
|
|||||||
NSDirectory::CreateDirectory(wsTempDir);
|
NSDirectory::CreateDirectory(wsTempDir);
|
||||||
|
|
||||||
CPdfFile pdfFile(pApplicationFonts);
|
CPdfFile pdfFile(pApplicationFonts);
|
||||||
pdfFile.SetTemp(wsTempDir);
|
pdfFile.SetTempDirectory(wsTempDir);
|
||||||
|
|
||||||
std::wstring wsPassword;
|
std::wstring wsPassword;
|
||||||
bool bResult = pdfFile.LoadFromFile(wsSrcFile);
|
bool bResult = pdfFile.LoadFromFile(wsSrcFile);
|
||||||
@ -69,7 +69,7 @@ int main()
|
|||||||
pCertificate = NSCertificate::FromFiles(wsPrivateKeyFile, sPrivateFilePassword, wsCertificateFile, sCertificateFilePassword);
|
pCertificate = NSCertificate::FromFiles(wsPrivateKeyFile, sPrivateFilePassword, wsCertificateFile, sCertificateFilePassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (false)
|
if (true)
|
||||||
{
|
{
|
||||||
double dPageDpiX, dPageDpiY, dWidth, dHeight;
|
double dPageDpiX, dPageDpiY, dWidth, dHeight;
|
||||||
pdfFile.GetPageInfo(0, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY);
|
pdfFile.GetPageInfo(0, &dWidth, &dHeight, &dPageDpiX, &dPageDpiY);
|
||||||
@ -134,7 +134,7 @@ int main()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pdfFile.EditClose();
|
pdfFile.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
RELEASEINTERFACE(pApplicationFonts);
|
RELEASEINTERFACE(pApplicationFonts);
|
||||||
|
|||||||
@ -1611,8 +1611,9 @@ namespace NExtractTools
|
|||||||
NSFonts::IApplicationFonts* pApplicationFonts = NSFonts::NSApplication::Create();
|
NSFonts::IApplicationFonts* pApplicationFonts = NSFonts::NSApplication::Create();
|
||||||
initApplicationFonts(pApplicationFonts, params);
|
initApplicationFonts(pApplicationFonts, params);
|
||||||
|
|
||||||
CPdfFile pdfWriter(pApplicationFonts, 2, params.getIsPDFA());
|
CPdfFile pdfWriter(pApplicationFonts);
|
||||||
pdfWriter.SetTempFolder(sTemp);
|
pdfWriter.CreatePdf(params.getIsPDFA());
|
||||||
|
pdfWriter.SetTempDirectory(sTemp);
|
||||||
|
|
||||||
CConvertFromBinParams oBufferParams;
|
CConvertFromBinParams oBufferParams;
|
||||||
oBufferParams.m_sThemesDirectory = sThemeDir;
|
oBufferParams.m_sThemesDirectory = sThemeDir;
|
||||||
@ -1865,8 +1866,9 @@ namespace NExtractTools
|
|||||||
NSFonts::IApplicationFonts* pApplicationFonts = NSFonts::NSApplication::Create();
|
NSFonts::IApplicationFonts* pApplicationFonts = NSFonts::NSApplication::Create();
|
||||||
initApplicationFonts(pApplicationFonts, params);
|
initApplicationFonts(pApplicationFonts, params);
|
||||||
|
|
||||||
CPdfFile pdfWriter(pApplicationFonts, 2, params.getIsPDFA());
|
CPdfFile pdfWriter(pApplicationFonts);
|
||||||
pdfWriter.SetTempFolder(sTemp);
|
pdfWriter.CreatePdf(params.getIsPDFA());
|
||||||
|
pdfWriter.SetTempDirectory(sTemp);
|
||||||
|
|
||||||
CConvertFromBinParams oBufferParams;
|
CConvertFromBinParams oBufferParams;
|
||||||
oBufferParams.m_sThemesDirectory = sThemeDir;
|
oBufferParams.m_sThemesDirectory = sThemeDir;
|
||||||
@ -3540,8 +3542,9 @@ namespace NExtractTools
|
|||||||
|
|
||||||
NSFonts::IApplicationFonts* pApplicationFonts = NSFonts::NSApplication::Create();
|
NSFonts::IApplicationFonts* pApplicationFonts = NSFonts::NSApplication::Create();
|
||||||
initApplicationFonts(pApplicationFonts, params);
|
initApplicationFonts(pApplicationFonts, params);
|
||||||
CPdfFile pdfWriter(pApplicationFonts, 2, params.getIsPDFA());
|
CPdfFile pdfWriter(pApplicationFonts);
|
||||||
pdfWriter.SetTempFolder(sTemp);
|
pdfWriter.CreatePdf(params.getIsPDFA());
|
||||||
|
pdfWriter.SetTempDirectory(sTemp);
|
||||||
|
|
||||||
CConvertFromBinParams oBufferParams;
|
CConvertFromBinParams oBufferParams;
|
||||||
oBufferParams.m_sThemesDirectory = sThemeDir;
|
oBufferParams.m_sThemesDirectory = sThemeDir;
|
||||||
@ -3585,7 +3588,7 @@ namespace NExtractTools
|
|||||||
IOfficeDrawingFile* pReader = NULL;
|
IOfficeDrawingFile* pReader = NULL;
|
||||||
if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatFrom)
|
if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatFrom)
|
||||||
{
|
{
|
||||||
pReader = new CPdfFile(pApplicationFonts, 1);
|
pReader = new CPdfFile(pApplicationFonts);
|
||||||
}
|
}
|
||||||
else if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU == nFormatFrom)
|
else if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU == nFormatFrom)
|
||||||
{
|
{
|
||||||
@ -3662,7 +3665,7 @@ namespace NExtractTools
|
|||||||
IOfficeDrawingFile* pReader = NULL;
|
IOfficeDrawingFile* pReader = NULL;
|
||||||
if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatFrom)
|
if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatFrom)
|
||||||
{
|
{
|
||||||
pReader = new CPdfFile(pApplicationFonts, 1);
|
pReader = new CPdfFile(pApplicationFonts);
|
||||||
}
|
}
|
||||||
else if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU == nFormatFrom)
|
else if(AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_DJVU == nFormatFrom)
|
||||||
{
|
{
|
||||||
@ -4730,9 +4733,9 @@ namespace NExtractTools
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CPdfFile pdfWriter(pApplicationFonts, 2, params.getIsPDFA());
|
CPdfFile pdfWriter(pApplicationFonts);
|
||||||
pdfWriter.SetTempFolder(sTemp);
|
pdfWriter.CreatePdf(params.getIsPDFA());
|
||||||
pdfWriter.SetTempFolder(sTemp);
|
pdfWriter.SetTempDirectory(sTemp);
|
||||||
|
|
||||||
std::wstring documentID = params.getDocumentID();
|
std::wstring documentID = params.getDocumentID();
|
||||||
if (false == documentID.empty())
|
if (false == documentID.empty())
|
||||||
@ -4782,7 +4785,7 @@ namespace NExtractTools
|
|||||||
switch (nFormatFrom)
|
switch (nFormatFrom)
|
||||||
{
|
{
|
||||||
case AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF:
|
case AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF:
|
||||||
pReader = new CPdfFile(pApplicationFonts, 1);
|
pReader = new CPdfFile(pApplicationFonts);
|
||||||
break;
|
break;
|
||||||
case AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS:
|
case AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_XPS:
|
||||||
pReader = new CXpsFile(pApplicationFonts);
|
pReader = new CXpsFile(pApplicationFonts);
|
||||||
|
|||||||
@ -188,7 +188,8 @@ std::wstring CXpsFile::GetInfo()
|
|||||||
#ifndef DISABLE_PDF_CONVERTATION
|
#ifndef DISABLE_PDF_CONVERTATION
|
||||||
void CXpsFile::ConvertToPdf(const std::wstring& wsPath)
|
void CXpsFile::ConvertToPdf(const std::wstring& wsPath)
|
||||||
{
|
{
|
||||||
CPdfFile oPdf(m_pInternal->m_pAppFonts, 2);
|
CPdfFile oPdf(m_pInternal->m_pAppFonts);
|
||||||
|
oPdf.CreatePdf();
|
||||||
bool bBreak = false;
|
bool bBreak = false;
|
||||||
|
|
||||||
int nPagesCount = GetPagesCount();
|
int nPagesCount = GetPagesCount();
|
||||||
|
|||||||
Reference in New Issue
Block a user