/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _PDF_METADATA_STREAM_INCLUDED_ #define _PDF_METADATA_STREAM_INCLUDED_ /*!DOM*/ #include "PdfStream.h" #include "OdCharMapper.h" #include "PdfMetadataStreamDictionary.h" namespace TD_PDF { class PDFIStream; class PDFVersion; class PDFEXPORT_TOOLKIT PDFMetadataStream : public PDFStream { PDF_DECLARE_OBJECT(PDFMetadataStream, PDFStream, kMetadataStream) OdAnsiCharArray m_sTitle; OdAnsiCharArray m_sAuthor; OdAnsiCharArray m_sSubject; OdAnsiCharArray m_sKeywords; OdAnsiCharArray m_sCreator; OdAnsiCharArray m_sProducer; OdTimeStamp m_creationDate; OdUInt16 m_iPdfALevel; OdUInt16 m_iPdfAConformance; protected: void InitObject() override; public: PDFMetadataStreamDictionaryPtr getDictionary(); virtual void putData(const char *pBuf, OdUInt32 nSize); virtual void getData(char *pBuf, OdUInt32 nSize); void setTitle(const OdString& sTitle) { OdCharMapper::unicodeToUtf8(sTitle.c_str(), sTitle.getLength(), m_sTitle); }; void setAuthor(const OdString& sAuthor) { OdCharMapper::unicodeToUtf8(sAuthor.c_str(), sAuthor.getLength(), m_sAuthor); }; void setSubject(const OdString& sSubject) { OdCharMapper::unicodeToUtf8(sSubject.c_str(), sSubject.getLength(), m_sSubject); }; void setKeywords(const OdString& sKeywords) { OdCharMapper::unicodeToUtf8(sKeywords.c_str(), sKeywords.getLength(), m_sKeywords); }; void setCreator(const OdString& sCreator) { OdCharMapper::unicodeToUtf8(sCreator.c_str(), sCreator.getLength(), m_sCreator); }; void setProducer(const OdString& sProducer) { OdCharMapper::unicodeToUtf8(sProducer.c_str(), sProducer.getLength(), m_sProducer); }; void setCreationDate(const OdTimeStamp& creationDate) { m_creationDate = creationDate; }; void setPdfALevelConf(OdUInt16 lev, OdUInt16 conf) //lev (1,2,3) conf (1 - A, 2 - B) { m_iPdfALevel = lev; m_iPdfAConformance = conf; } bool Export(PDFIStream *pStream, const PDFVersion &ver) override; }; typedef PDFSmartPtr PDFMetadataStreamPtr; }; #endif //_PDF_METADATA_STREAM_INCLUDED_