I additional created a patch file based on trunk revision 1697.




Julian Rehborn
Junior Software Engineer
________________________________________
GBS PAVONE Groupware GmbH
Im Dörener Feld 3
33100 Paderborn
Germany
Phone: +49 52 51 31 02-0
Fax: +49 52 51 31 02-99
www.pavone.de
________________________________________



--
GBS PAVONE Groupware GmbH Disclaimer
automatically added by GBS Email Management Solutions

Sitz der Gesellschaft:
GBS PAVONE Groupware GmbH
Hospitalstr. 6
99817 Eisenach
Germany

Webseite: http://www.pavone.de, E-Mail: i...@pavone.de

Registereintragung: Amtsgericht Jena HRB 508241
Umsatzsteuer-Identifikations-Nummer gemäß Paragraph 27a UstG: DE 185612304
Geschäftsführer: Jörg Ott



----- Forwarded by Julian Rehborn/EU/GBS on 30.11.2015 20:13 -----

From:   Julian Rehborn/EU/GBS
To:     podofo-users@lists.sourceforge.net
Date:   30.11.2015 15:53
Subject:        Set CreationDate and ModDate during file embedding


Hi,
I currently want to implement that CreationDate and ModDate are set during
the file embedding, because the ModDate is required by the PDF/A-3
specifications.
My idea is to implement it by following.


#############
# PdfInputStream.cpp //Method declarations and include needs to be done in
PdfInputStream.h
#############
#include "base\PdfDate.h"

PdfDate PdfFileInputStream::GetModifiedDate()
{
    struct stat file_stat;
    int fp = fileno(m_hFile);
    fstat(fp, &file_stat);
    return PdfDate(file_stat.st_mtime);
}


PdfDate PdfFileInputStream::GetCreationDate()
{
    struct stat file_stat;
    int fp = fileno(m_hFile);
    fstat(fp, &file_stat);
    return PdfDate(file_stat.st_ctime);
}

#############
# PdfFileSpec.cpp
#############
void PdfFileSpec::EmbeddFile( PdfObject* pStream, const wchar_t*
pszFilename ) const
{
    PdfFileInputStream stream( pszFilename );
    pStream->GetStream()->Set( &stream );
    // Add additional information about the embedded file to the stream
    PdfDictionary params;
    params.AddKey( "Size", static_cast<pdf_int64>(stream.GetFileLength())
);
    PdfString mod_date;
    stream.GetModifiedDate().ToString(mod_date);
    params.AddKey("ModDate", mod_date);
    PdfString creation_date;
    stream.GetCreationDate().ToString(creation_date);
    params.AddKey("CreationDate", creation_date);
    pStream->GetDictionary().AddKey("Params", params );
}

void PdfFileSpec::EmbeddFile( PdfObject* pStream, const char* pszFilename
) const
{
    PdfFileInputStream stream( pszFilename );
    pStream->GetStream()->Set( &stream );

    // Add additional information about the embedded file to the stream
    PdfDictionary params;
    params.AddKey( "Size", static_cast<pdf_int64>(stream.GetFileLength())
);
    PdfString mod_date;
    stream.GetModifiedDate().ToString(mod_date);
    params.AddKey( "ModDate", mod_date);
    PdfString creation_date;
    stream.GetCreationDate().ToString(creation_date);
    params.AddKey( "CreationDate", creation_date );
    pStream->GetDictionary().AddKey("Params", params );
}

Are there some things if forgot or could be done better?
If not will someone implement it or should I create a patch file for that?



Attachment: embedd_file_cdate_mdate.patch
Description: Binary data

------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to