diff --git a/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp b/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp index a62f7ee2ed..d4c3c42aff 100644 --- a/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp +++ b/DesktopEditor/graphics/pro/js/wasm/src/drawingfile_test.cpp @@ -278,6 +278,13 @@ void ReadAnnot(BYTE* pWidgets, int& i) std::cout << "User ID " << std::string((char*)(pWidgets + i), nPathLength) << ", "; i += nPathLength; } + if (nFlags & (1 << 9)) + { + nPathLength = READ_INT(pWidgets + i); + i += 4; + std::cout << "OMetadata " << std::string((char*)(pWidgets + i), nPathLength) << ", "; + i += nPathLength; + } } void ReadInteractiveForms(BYTE* pWidgets, int& i) @@ -581,13 +588,6 @@ void ReadInteractiveForms(BYTE* pWidgets, int& i) std::cout << "Font button " << std::string((char*)(pWidgets + i), nPathLength) << ", "; i += nPathLength; } - if (nFlags & (1 << 20)) - { - nPathLength = READ_INT(pWidgets + i); - i += 4; - std::cout << "OMetadata " << std::string((char*)(pWidgets + i), nPathLength) << ", "; - i += nPathLength; - } //Action diff --git a/PdfFile/SrcReader/PdfAnnot.cpp b/PdfFile/SrcReader/PdfAnnot.cpp index 454a63d1db..3901e0a156 100644 --- a/PdfFile/SrcReader/PdfAnnot.cpp +++ b/PdfFile/SrcReader/PdfAnnot.cpp @@ -1491,9 +1491,6 @@ CAnnotWidget::CAnnotWidget(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefI m_sT = DictLookupString(&oField, "T", 18); m_sFullName = m_sT; - // 20 - OO метаданные форм - OMetadata - m_sOMetadata = DictLookupString(&oField, "OMetadata", 20); - // Action - A Object oAction; if (oField.dictLookup("A", &oAction)->isDict()) @@ -3317,6 +3314,16 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, AcroFormField* pField, int nStartRefID) delete s; } oObj.free(); + + // 9 - OO метаданные форм - OMetadata + if (pField->fieldLookup("OMetadata", &oObj)->isString()) + { + m_unAFlags |= (1 << 9); + TextString* s = new TextString(oObj.getString()); + m_sOMetadata = NSStringExt::CConverter::GetUtf8FromUTF32(s->getUnicode(), s->getLength()); + delete s; + } + oObj.free(); } CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefID) { @@ -3444,6 +3451,9 @@ CAnnot::CAnnot(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex, int nStartRefI } oObj.free(); + // 9 - OO метаданные форм - OMetadata + m_sOMetadata = DictLookupString(&oAnnot, "OMetadata", 9); + oAnnot.free(); } CAnnot::~CAnnot() @@ -3950,6 +3960,8 @@ void CAnnot::ToWASM(NSWasm::CData& oRes) oRes.WriteString(m_sM); if (m_unAFlags & (1 << 7)) oRes.WriteString(m_sOUserID); + if (m_unAFlags & (1 << 9)) + oRes.WriteString(m_sOMetadata); } void CAnnot::CBorderType::ToWASM(NSWasm::CData& oRes) { @@ -4015,8 +4027,6 @@ void CAnnotWidget::ToWASM(NSWasm::CData& oRes) oRes.WriteString(m_sT); if (m_unFlags & (1 << 19)) oRes.WriteString(m_sButtonFontName); - if (m_unFlags & (1 << 20)) - oRes.WriteString(m_sOMetadata); oRes.AddInt(m_arrAction.size()); for (int i = 0; i < m_arrAction.size(); ++i) { diff --git a/PdfFile/SrcReader/PdfAnnot.h b/PdfFile/SrcReader/PdfAnnot.h index e5e284e117..3a3c9067c7 100644 --- a/PdfFile/SrcReader/PdfAnnot.h +++ b/PdfFile/SrcReader/PdfAnnot.h @@ -204,6 +204,7 @@ private: std::string m_sNM; // Уникальное имя std::string m_sM; // Дата последнего изменения std::string m_sOUserID; // OO User ID + std::string m_sOMetadata; // OO метаданные формы std::vector m_arrC; // Специальный цвет CBorderType* m_pBorder; // Граница }; @@ -255,7 +256,6 @@ private: std::string m_sFontKey; // Уникальный идентификатор шрифта std::string m_sFullName; // Полное имя поля std::string m_sFontName; // Имя шрифта - из DA - std::string m_sOMetadata; // OO метаданные формы std::string m_sActualFontName; // Имя замененного шрифта std::string m_sButtonFontName; // Имя шрифта кнопки };