Create AnnotField for MetafileToRenderer

This commit is contained in:
Kulikova Svetlana
2023-08-07 17:54:05 +03:00
parent bcc465396c
commit b5f1cfc578
7 changed files with 117 additions and 2 deletions

View File

@ -0,0 +1,33 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "./AnnotField.h"

View File

@ -0,0 +1,48 @@
/*
* (c) Copyright Ascensio System SIA 2010-2023
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at 20A-6 Ernesta Birznieka-Upish
* street, Riga, Latvia, EU, LV-1050.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _BUILD_ANNOTFIELD_H_
#define _BUILD_ANNOTFIELD_H_
#include "config.h"
#include "IRenderer.h"
class GRAPHICS_DECL CAnnotFieldInfo : public IAnnotField
{
public:
CAnnotFieldInfo();
virtual ~CAnnotFieldInfo();
void SetType(int nType);
bool IsValid() const;
};
#endif // _BUILD_ANNOTFIELD_H_

View File

@ -140,6 +140,13 @@ public:
virtual ~IFormField() {}
};
class IAnnotField
{
public:
IAnnotField() {}
virtual ~IAnnotField() {}
};
namespace Aggplus { class CImage; }
// IRenderer

View File

@ -1234,6 +1234,18 @@ namespace NSOnlineOfficeBinToPdf
break;
}
case ctAnnotField:
{
BYTE* nStartPos = current;
int nStartIndex = curindex;
int nLen = ReadInt(current, curindex);
current = nStartPos + nLen;
curindex = nStartIndex + nLen;
break;
}
case ctDocInfo:
{
int nFlags = ReadInt(current, curindex);
@ -1568,6 +1580,18 @@ namespace NSOnlineOfficeBinToPdf
curindex = nStartIndex + nLen;
break;
}
case ctAnnotField:
{
BYTE* nStartPos = current;
int nStartIndex = curindex;
int nLen = ReadInt(current, curindex);
current = nStartPos + nLen;
curindex = nStartIndex + nLen;
break;
break;
}
case ctDocInfo:
{
int nFlags = ReadInt(current, curindex);

View File

@ -179,6 +179,7 @@ namespace NSOnlineOfficeBinToPdf
ctLink = 161,
ctFormField = 162,
ctDocInfo = 163,
ctAnnotField = 164,
ctPageWidth = 200,
ctPageHeight = 201,

View File

@ -110,6 +110,7 @@ HEADERS += \
./../MetafileToRendererCheck.h \
./../MetafileToGraphicsRenderer.h \
./../FormField.h \
./../AnnotField.h \
./../structures.h \
./../shading_info.h \
./../Graphics.h \
@ -127,6 +128,7 @@ SOURCES += \
./../MetafileToRenderer.cpp \
./../MetafileToGraphicsRenderer.cpp \
./../FormField.cpp \
./../AnnotField.cpp \
\
./pro_Image.cpp \
./pro_Graphics.cpp

View File

@ -90,7 +90,7 @@ int main()
}
ICertificate* pCertificate = NULL;
if (true)
if (false)
{
std::wstring wsCertificateFile = NSFile::GetProcessDirectory() + L"/test.pfx";
std::wstring wsPrivateKeyFile = L"";
@ -109,7 +109,7 @@ int main()
pCertificate = NSCertificate::GenerateByAlg("ed25519", properties);
}
if (false)
if (true)
{
pdfFile.CreatePdf();
pdfFile.OnlineWordToPdfFromBinary(NSFile::GetProcessDirectory() + L"/pdf.bin", wsDstFile);