podofo-svn Mailing List for PoDoFo (Page 2)
A PDF parsing, modification and creation library.
Brought to you by:
domseichter
This list is closed, nobody may subscribe to it.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(39) |
Jul
(42) |
Aug
(134) |
Sep
(48) |
Oct
(105) |
Nov
(19) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(48) |
Feb
(70) |
Mar
(26) |
Apr
(13) |
May
(49) |
Jun
(40) |
Jul
(49) |
Aug
(34) |
Sep
(49) |
Oct
(20) |
Nov
(71) |
Dec
(4) |
2008 |
Jan
(14) |
Feb
(2) |
Mar
(6) |
Apr
(24) |
May
(33) |
Jun
(36) |
Jul
(12) |
Aug
(26) |
Sep
(37) |
Oct
(35) |
Nov
(10) |
Dec
(15) |
2009 |
Jan
(4) |
Feb
(1) |
Mar
(9) |
Apr
(39) |
May
(14) |
Jun
(17) |
Jul
(46) |
Aug
(37) |
Sep
(3) |
Oct
(8) |
Nov
(7) |
Dec
(13) |
2010 |
Jan
(3) |
Feb
(18) |
Mar
(5) |
Apr
(23) |
May
(16) |
Jun
(19) |
Jul
(7) |
Aug
(29) |
Sep
(12) |
Oct
(43) |
Nov
(20) |
Dec
(14) |
2011 |
Jan
(22) |
Feb
(5) |
Mar
(36) |
Apr
(12) |
May
(2) |
Jun
(4) |
Jul
(3) |
Aug
(1) |
Sep
(4) |
Oct
(8) |
Nov
(2) |
Dec
(6) |
2012 |
Jan
(6) |
Feb
|
Mar
(2) |
Apr
|
May
(4) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
(6) |
Mar
(3) |
Apr
(1) |
May
(24) |
Jun
(2) |
Jul
(12) |
Aug
(3) |
Sep
(1) |
Oct
(17) |
Nov
|
Dec
|
2014 |
Jan
(2) |
Feb
(1) |
Mar
(4) |
Apr
(11) |
May
(4) |
Jun
(47) |
Jul
(13) |
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
(2) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
(2) |
Sep
(4) |
Oct
(7) |
Nov
(10) |
Dec
(2) |
2016 |
Jan
|
Feb
(2) |
Mar
|
Apr
(16) |
May
(45) |
Jun
(8) |
Jul
(6) |
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(13) |
Dec
(5) |
2017 |
Jan
(15) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(8) |
Jun
(5) |
Jul
(2) |
Aug
(1) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
(3) |
2018 |
Jan
(12) |
Feb
(17) |
Mar
(12) |
Apr
(16) |
May
(1) |
Jun
(1) |
Jul
(5) |
Aug
(5) |
Sep
(6) |
Oct
(3) |
Nov
(7) |
Dec
(3) |
2019 |
Jan
(4) |
Feb
(10) |
Mar
(5) |
Apr
(6) |
May
(12) |
Jun
(2) |
Jul
(3) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
(8) |
Apr
|
May
(4) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
|
Oct
(3) |
Nov
|
Dec
(2) |
2021 |
Jan
(15) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(10) |
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2022 |
Jan
(1) |
Feb
|
Mar
(6) |
Apr
(5) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mc...@us...> - 2021-08-18 17:14:54
|
Revision: 2041 http://sourceforge.net/p/podofo/code/2041 Author: mc-zyx Date: 2021-08-18 17:14:51 +0000 (Wed, 18 Aug 2021) Log Message: ----------- Patch by Christopher Creutzig: PdfXRefStreamParserObject: Correct 'indeces' typos Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.cpp podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.h Modified: podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.cpp =================================================================== --- podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.cpp 2021-08-18 17:02:34 UTC (rev 2040) +++ podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.cpp 2021-08-18 17:14:51 UTC (rev 2041) @@ -113,13 +113,13 @@ nW[i] = static_cast<pdf_int64>(vWArray.GetArray()[i].GetNumber()); } - std::vector<pdf_int64> vecIndeces; - GetIndeces( vecIndeces, static_cast<pdf_int64>(lSize) ); + std::vector<pdf_int64> vecIndices; + GetIndices( vecIndices, static_cast<pdf_int64>(lSize) ); - ParseStream( nW, vecIndeces ); + ParseStream( nW, vecIndices ); } -void PdfXRefStreamParserObject::ParseStream( const pdf_int64 nW[W_ARRAY_SIZE], const std::vector<pdf_int64> & rvecIndeces ) +void PdfXRefStreamParserObject::ParseStream( const pdf_int64 nW[W_ARRAY_SIZE], const std::vector<pdf_int64> & rvecIndices ) { char* pBuffer; pdf_long lBufferLen; @@ -147,7 +147,7 @@ this->GetStream()->GetFilteredCopy( &pBuffer, &lBufferLen ); - std::vector<pdf_int64>::const_iterator it = rvecIndeces.begin(); + std::vector<pdf_int64>::const_iterator it = rvecIndices.begin(); #ifdef PODOFO_HAVE_UNIQUE_PTR std::unique_ptr<char, decltype( &podofo_free )> pStart( pBuffer, &podofo_free ); #else // PODOFO_HAVE_UNIQUE_PTR @@ -164,7 +164,7 @@ StrAutoPtr pStart( pBuffer ); #endif // PODOFO_HAVE_UNIQUE_PTR - while( it != rvecIndeces.end() ) + while( it != rvecIndices.end() ) { pdf_int64 nFirstObj = *it; ++it; pdf_int64 nCount = *it; ++it; @@ -200,7 +200,7 @@ } } -void PdfXRefStreamParserObject::GetIndeces( std::vector<pdf_int64> & rvecIndeces, pdf_int64 size ) +void PdfXRefStreamParserObject::GetIndices( std::vector<pdf_int64> & rvecIndices, pdf_int64 size ) { // get the first object number in this crossref stream. // it is not required to have an index key though. @@ -215,7 +215,7 @@ TCIVariantList it = array.GetArray().begin(); while ( it != array.GetArray().end() ) { - rvecIndeces.push_back( (*it).GetNumber() ); + rvecIndices.push_back( (*it).GetNumber() ); ++it; } } @@ -222,12 +222,12 @@ else { // Default - rvecIndeces.push_back( static_cast<pdf_int64>(0) ); - rvecIndeces.push_back( size ); + rvecIndices.push_back( static_cast<pdf_int64>(0) ); + rvecIndices.push_back( size ); } - // vecIndeces must be a multiple of 2 - if( rvecIndeces.size() % 2 != 0) + // vecIndices must be a multiple of 2 + if( rvecIndices.size() % 2 != 0) { PODOFO_RAISE_ERROR( ePdfError_NoXRef ); } Modified: podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.h =================================================================== --- podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.h 2021-08-18 17:02:34 UTC (rev 2040) +++ podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.h 2021-08-18 17:14:51 UTC (rev 2041) @@ -86,20 +86,20 @@ * Read the /Index key from the current dictionary * and write it to a vector. * - * \param rvecIndeces store the indeces hare + * \param rvecIndices store the indices hare * \param size default value from /Size key */ - void GetIndeces( std::vector<pdf_int64> & rvecIndeces, pdf_int64 size ); + void GetIndices( std::vector<pdf_int64> & rvecIndices, pdf_int64 size ); /** * Parse the stream contents * * \param nW /W key - * \param rvecIndeces indeces as filled by GetIndeces + * \param rvecIndices indices as filled by GetIndices * - * \see GetIndeces + * \see GetIndices */ - void ParseStream( const pdf_int64 nW[W_ARRAY_SIZE], const std::vector<pdf_int64> & rvecIndeces ); + void ParseStream( const pdf_int64 nW[W_ARRAY_SIZE], const std::vector<pdf_int64> & rvecIndices ); void ReadXRefStreamEntry( char* pBuffer, pdf_long, const pdf_int64 lW[W_ARRAY_SIZE], int nObjNo ); private: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-08-18 17:02:36
|
Revision: 2040 http://sourceforge.net/p/podofo/code/2040 Author: mc-zyx Date: 2021-08-18 17:02:34 +0000 (Wed, 18 Aug 2021) Log Message: ----------- Patch by Christopher Creutzig: Introduce PdfEncrypt::IsOwnerPasswordSet() An application reading PDF must adhere to permissions for printing, copying, etc., unless the owner password was used to open it. Closes https://sourceforge.net/p/podofo/tickets/96/ Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfEncrypt.h Modified: podofo/trunk/src/podofo/base/PdfEncrypt.h =================================================================== --- podofo/trunk/src/podofo/base/PdfEncrypt.h 2021-08-18 16:54:32 UTC (rev 2039) +++ podofo/trunk/src/podofo/base/PdfEncrypt.h 2021-08-18 17:02:34 UTC (rev 2040) @@ -262,6 +262,17 @@ */ inline EPdfEncryptAlgorithm GetEncryptAlgorithm() const; + /** Checks if an owner password is set. + * An application reading PDF must adhere to permissions for printing, + * copying, etc., unless the owner password was used to open it. + * + * \returns true if the owner password is set, in which case + * IsPrintAllowed etc. should be ignored + * + * \see PdfEncrypt to set own document permissions. + */ + inline bool IsOwnerPasswordSet() const { return !m_ownerPass.empty(); }; + /** Checks if printing this document is allowed. * Every PDF consuming applications has to adhere this value! * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-08-18 16:54:34
|
Revision: 2039 http://sourceforge.net/p/podofo/code/2039 Author: mc-zyx Date: 2021-08-18 16:54:32 +0000 (Wed, 18 Aug 2021) Log Message: ----------- Patch by Michal Sudolsky: Fix bug when drawing text using truetype font with difference encoding loaded from pdf Closes https://sourceforge.net/p/podofo/tickets/77/ Modified Paths: -------------- podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.cpp Modified: podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.cpp =================================================================== --- podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.cpp 2021-08-18 16:27:51 UTC (rev 2038) +++ podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.cpp 2021-08-18 16:54:32 UTC (rev 2039) @@ -2412,7 +2412,8 @@ curCode = (*it).GetNumber(); else if( (*it).IsName() ) { - m_differences.AddDifference( static_cast<int>(curCode), 0, (*it).GetName(), bExplicitNames ); + pdf_utf16be unicodeValue = PdfDifferenceEncoding::NameToUnicodeID( (*it).GetName() ); + m_differences.AddDifference( static_cast<int>(curCode), unicodeValue, (*it).GetName(), bExplicitNames ); ++curCode; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-08-18 16:27:52
|
Revision: 2038 http://sourceforge.net/p/podofo/code/2038 Author: mc-zyx Date: 2021-08-18 16:27:51 +0000 (Wed, 18 Aug 2021) Log Message: ----------- Patch by Christopher Creutzig: CVE-2019-10723 - Excessive memory allocation crash at PdfPagesTreeCache Given the offending instruction is just preallocating memory for performance, use an arbitrary limit for preallocation. Closes https://sourceforge.net/p/podofo/tickets/46/ Modified Paths: -------------- podofo/trunk/src/podofo/doc/PdfPagesTreeCache.cpp Modified: podofo/trunk/src/podofo/doc/PdfPagesTreeCache.cpp =================================================================== --- podofo/trunk/src/podofo/doc/PdfPagesTreeCache.cpp 2021-08-18 16:15:15 UTC (rev 2037) +++ podofo/trunk/src/podofo/doc/PdfPagesTreeCache.cpp 2021-08-18 16:27:51 UTC (rev 2038) @@ -42,7 +42,9 @@ PdfPagesTreeCache::PdfPagesTreeCache( int nInitialSize ) { - m_deqPageObjs.resize( nInitialSize ); + if (nInitialSize > 0 && nInitialSize < (1L << 20)) { + m_deqPageObjs.resize( nInitialSize ); + } } PdfPagesTreeCache::~PdfPagesTreeCache() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-08-18 16:15:17
|
Revision: 2037 http://sourceforge.net/p/podofo/code/2037 Author: mc-zyx Date: 2021-08-18 16:15:15 +0000 (Wed, 18 Aug 2021) Log Message: ----------- Fix by Matthew Brincke: CVE-2018-12983 - stack-based buffer over-read in the PdfEncryptMD5Base::ComputeEncryptionKey() Closes https://sourceforge.net/p/podofo/tickets/23/ Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfEncrypt.cpp Modified: podofo/trunk/src/podofo/base/PdfEncrypt.cpp =================================================================== --- podofo/trunk/src/podofo/base/PdfEncrypt.cpp 2021-08-18 16:13:53 UTC (rev 2036) +++ podofo/trunk/src/podofo/base/PdfEncrypt.cpp 2021-08-18 16:15:15 UTC (rev 2037) @@ -615,6 +615,12 @@ && PdfEncrypt::IsEncryptionEnabled( ePdfEncryptAlgorithm_RC4V2 ) ) { // [Alexey] - lLength is pdf_int64. Please make changes in encryption algorithms + // [mabri] - Fix CVE-2018-12983: Check key length lLength here + // to prevent stack-based buffer over-read later in this file + if (lLength > MD5_DIGEST_LENGTH * 8) // lLength in bits, md5 in bytes + { + PODOFO_RAISE_ERROR_INFO( ePdfError_ValueOutOfRange, "Given key length too large for MD5." ); + } pdfEncrypt = new PdfEncryptRC4(oValue, uValue, pValue, rValue, ePdfEncryptAlgorithm_RC4V2, static_cast<int>(lLength), encryptMetadata); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-08-18 16:13:54
|
Revision: 2036 http://sourceforge.net/p/podofo/code/2036 Author: mc-zyx Date: 2021-08-18 16:13:53 +0000 (Wed, 18 Aug 2021) Log Message: ----------- EncryptTest: Fallback to Helvetica font, when Arial cannot be loaded It helps to pass the test on systems without the Arial font. Modified Paths: -------------- podofo/trunk/test/unit/EncryptTest.cpp Modified: podofo/trunk/test/unit/EncryptTest.cpp =================================================================== --- podofo/trunk/test/unit/EncryptTest.cpp 2021-07-18 09:58:49 UTC (rev 2035) +++ podofo/trunk/test/unit/EncryptTest.cpp 2021-08-18 16:13:53 UTC (rev 2036) @@ -301,7 +301,12 @@ PdfPainter painter; painter.SetPage( pPage ); - PdfFont* pFont = writer.CreateFont( "Arial", PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), false ); + PdfFont* pFont = NULL; + try { + pFont = writer.CreateFont( "Arial", PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), false ); + } catch( PdfError & e ) { + pFont = writer.CreateFont( "Helvetica", PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), false ); + } if( !pFont ) { PODOFO_RAISE_ERROR( ePdfError_InvalidHandle ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-07-18 09:58:58
|
Revision: 2035 http://sourceforge.net/p/podofo/code/2035 Author: mc-zyx Date: 2021-07-18 09:58:49 +0000 (Sun, 18 Jul 2021) Log Message: ----------- Patch by Michal Sudolsky: Correct string width when using font loaded from pdf Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfEncoding.h podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.h podofo/trunk/src/podofo/doc/PdfFontMetricsObject.cpp Modified: podofo/trunk/src/podofo/base/PdfEncoding.h =================================================================== --- podofo/trunk/src/podofo/base/PdfEncoding.h 2021-07-18 09:29:17 UTC (rev 2034) +++ podofo/trunk/src/podofo/base/PdfEncoding.h 2021-07-18 09:58:49 UTC (rev 2035) @@ -220,6 +220,16 @@ */ virtual pdf_utf16be GetCharCode( int nIndex ) const = 0; + virtual pdf_uint16 GetEncodedUnicode( pdf_uint16 unicodeValue ) const + { + if( m_bToUnicodeIsLoaded ) + { + return GetCIDValue( unicodeValue ); + } + + return unicodeValue; + } + protected: bool m_bToUnicodeIsLoaded; ///< If true, ToUnicode has been parsed @@ -408,6 +418,20 @@ char GetUnicodeCharCode(pdf_utf16be unicodeValue) const; + pdf_uint16 GetEncodedUnicode( pdf_uint16 unicodeValue ) const + { + if( m_bToUnicodeIsLoaded ) + { + return PdfEncoding::GetEncodedUnicode( unicodeValue ); + } + +#ifdef PODOFO_IS_LITTLE_ENDIAN + unicodeValue = ((unicodeValue & 0xff00) >> 8) | ((unicodeValue & 0xff) << 8); +#endif // PODOFO_IS_LITTLE_ENDIAN + + return static_cast<unsigned char>(GetUnicodeCharCode( unicodeValue )); + } + private: /** Initialize the internal table of mappings from Unicode code points * to encoded byte values. Modified: podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.h =================================================================== --- podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.h 2021-07-18 09:29:17 UTC (rev 2034) +++ podofo/trunk/src/podofo/doc/PdfDifferenceEncoding.h 2021-07-18 09:58:49 UTC (rev 2035) @@ -283,6 +283,21 @@ */ virtual pdf_utf16be GetCharCode( int nIndex ) const; + pdf_uint16 GetEncodedUnicode( pdf_uint16 unicodeValue ) const + { +#ifdef PODOFO_IS_LITTLE_ENDIAN + unicodeValue = ((unicodeValue & 0xff00) >> 8) | ((unicodeValue & 0xff) << 8); +#endif // PODOFO_IS_LITTLE_ENDIAN + + char val; + if (!m_differences.ContainsUnicodeValue( unicodeValue, val )) + { + val = static_cast<const PdfSimpleEncoding*>(GetBaseEncoding())->GetUnicodeCharCode( unicodeValue ); + } + + return static_cast<unsigned char>(val); + } + protected: /** Get a unique ID for this encoding Modified: podofo/trunk/src/podofo/doc/PdfFontMetricsObject.cpp =================================================================== --- podofo/trunk/src/podofo/doc/PdfFontMetricsObject.cpp 2021-07-18 09:29:17 UTC (rev 2034) +++ podofo/trunk/src/podofo/doc/PdfFontMetricsObject.cpp 2021-07-18 09:58:49 UTC (rev 2035) @@ -203,23 +203,13 @@ double PdfFontMetricsObject::CharWidth( unsigned char c ) const { - if( c >= m_nFirst && c <= m_nLast - && c - m_nFirst < static_cast<int>(m_width.GetSize()) ) - { - double dWidth = m_width[c - m_nFirst].GetReal(); - - return (dWidth * m_matrix.front().GetReal() * this->GetFontSize() + this->GetFontCharSpace()) * this->GetFontScale() / 100.0; - - } - - if( m_missingWidth != NULL ) - return m_missingWidth->GetReal (); - else - return m_dDefWidth; + return UnicodeCharWidth(c); } double PdfFontMetricsObject::UnicodeCharWidth( unsigned short c ) const { + c = m_pEncoding->GetEncodedUnicode(c); + if( c >= m_nFirst && c <= m_nLast && c - m_nFirst < static_cast<int>(m_width.GetSize()) ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mc...@us...> - 2021-07-18 09:29:26
|
Revision: 2034 http://sourceforge.net/p/podofo/code/2034 Author: mc-zyx Date: 2021-07-18 09:29:17 +0000 (Sun, 18 Jul 2021) Log Message: ----------- Patch by Christopher Creutzig: Correct typos in code comments Modified Paths: -------------- podofo/trunk/src/podofo/base/Pdf3rdPtyForwardDecl.h podofo/trunk/src/podofo/base/PdfArray.h podofo/trunk/src/podofo/base/PdfCanvas.h podofo/trunk/src/podofo/base/PdfColor.h podofo/trunk/src/podofo/base/PdfCompilerCompat.h podofo/trunk/src/podofo/base/PdfCompilerCompatPrivate.h podofo/trunk/src/podofo/base/PdfContentsTokenizer.h podofo/trunk/src/podofo/base/PdfData.h podofo/trunk/src/podofo/base/PdfDate.h podofo/trunk/src/podofo/base/PdfDefines.h podofo/trunk/src/podofo/base/PdfDictionary.h podofo/trunk/src/podofo/base/PdfEncoding.h podofo/trunk/src/podofo/base/PdfEncodingFactory.h podofo/trunk/src/podofo/base/PdfEncrypt.h podofo/trunk/src/podofo/base/PdfError.h podofo/trunk/src/podofo/base/PdfFiltersPrivate.h podofo/trunk/src/podofo/base/PdfImmediateWriter.h podofo/trunk/src/podofo/base/PdfInputDevice.h podofo/trunk/src/podofo/base/PdfInputStream.h podofo/trunk/src/podofo/base/PdfLocale.h podofo/trunk/src/podofo/base/PdfMemStream.h podofo/trunk/src/podofo/base/PdfName.h podofo/trunk/src/podofo/base/PdfObjectStreamParserObject.h podofo/trunk/src/podofo/base/PdfOutputDevice.h podofo/trunk/src/podofo/base/PdfOutputStream.h podofo/trunk/src/podofo/base/PdfParser.h podofo/trunk/src/podofo/base/PdfParserObject.h podofo/trunk/src/podofo/base/PdfRefCountedBuffer.h podofo/trunk/src/podofo/base/PdfRefCountedInputDevice.h podofo/trunk/src/podofo/base/PdfReference.h podofo/trunk/src/podofo/base/PdfString.h podofo/trunk/src/podofo/base/PdfTokenizer.h podofo/trunk/src/podofo/base/PdfVariant.h podofo/trunk/src/podofo/base/PdfVecObjects.h podofo/trunk/src/podofo/base/PdfWriter.h podofo/trunk/src/podofo/base/PdfXRef.h podofo/trunk/src/podofo/base/PdfXRefStreamParserObject.h Modified: podofo/trunk/src/podofo/base/Pdf3rdPtyForwardDecl.h =================================================================== --- podofo/trunk/src/podofo/base/Pdf3rdPtyForwardDecl.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/Pdf3rdPtyForwardDecl.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -13,7 +13,7 @@ * * - They dump a huge amount of cruft into the top level namespace * - * - Programs that haven't gone through the apallingly convoluted process required + * - Programs that haven't gone through the appallingly convoluted process required * to add freetype's header path can't include podofo's headers even if they have no * intention of using any freetype-related font features. */ Modified: podofo/trunk/src/podofo/base/PdfArray.h =================================================================== --- podofo/trunk/src/podofo/base/PdfArray.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfArray.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -227,7 +227,7 @@ */ inline const_reverse_iterator rend() const; -#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround template-error in Visualstudio 6 +#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround template-error in Visual Studio 6 inline void insert(iterator __position, iterator __first, iterator __last); @@ -446,7 +446,7 @@ // ----------------------------------------------------- // // ----------------------------------------------------- -#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround template-error in Visualstudio 6 +#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround template-error in Visual Studio 6 void PdfArray::insert(PdfArray::iterator __position, PdfArray::iterator __first, PdfArray::iterator __last) Modified: podofo/trunk/src/podofo/base/PdfCanvas.h =================================================================== --- podofo/trunk/src/podofo/base/PdfCanvas.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfCanvas.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -85,7 +85,7 @@ static const PdfArray GetProcSet(); /** Register a colourspace for a (separation) colour in the resource dictionary - * of this page or XObbject so that it can be used for any following drawing + * of this page or XObject so that it can be used for any following drawing * operations. * * \param rColor reference to the PdfColor Modified: podofo/trunk/src/podofo/base/PdfColor.h =================================================================== --- podofo/trunk/src/podofo/base/PdfColor.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfColor.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -63,7 +63,7 @@ /** Create a new PdfColor object with * a grayscale value. * - * \param dGray a grayscalue value between 0.0 and 1.0 + * \param dGray a grayscale value between 0.0 and 1.0 */ explicit PdfColor( double dGray ); @@ -106,7 +106,7 @@ /** Test for equality of colors. * - * \param rhs color to compare ro + * \param rhs color to compare to * * \returns true if object color is equal to rhs */ @@ -114,7 +114,7 @@ /** Test for inequality of colors. * - * \param rhs color to compare ro + * \param rhs color to compare to * * \returns true if object color is not equal to rhs */ @@ -307,7 +307,7 @@ /** Converts the color object into a grayscale * color object. * - * This is only a convinience function. It might be useful + * This is only a convenience function. It might be useful * for on screen display but is in NO WAY suitable to * professional printing! * @@ -319,7 +319,7 @@ /** Converts the color object into a RGB * color object. * - * This is only a convinience function. It might be useful + * This is only a convenience function. It might be useful * for on screen display but is in NO WAY suitable to * professional printing! * @@ -331,7 +331,7 @@ /** Converts the color object into a CMYK * color object. * - * This is only a convinience function. It might be useful + * This is only a convenience function. It might be useful * for on screen display but is in NO WAY suitable to * professional printing! * @@ -351,7 +351,7 @@ * * Supported values are: * - single gray values as string (e.g. '0.5') - * - a named color (e.g. 'auquamarine' or 'magenta') + * - a named color (e.g. 'aquamarine' or 'magenta') * - hex values (e.g. #FF002A (RGB) or #FF12AB3D (CMYK)) * - PdfArray's * @@ -369,18 +369,20 @@ static PdfColor FromArray( const PdfArray & rArray ); /** - * Convert a name into a colorspace enum. - * @param rName name representing a colorspace such as DeviceGray - * @returns colorspace enum or ePdfColorSpace_Unknown if name is unknown - * @see GetNameForColorSpace + * Convert a name into a colorspace enum. + * + * \param rName name representing a colorspace such as DeviceGray + * \returns colorspace enum or ePdfColorSpace_Unknown if name is unknown + * \see GetNameForColorSpace */ static EPdfColorSpace GetColorSpaceForName( const PdfName & rName ); /** - * Convert a colorspace enum value into a name such as DeviceRGB - * @param eColorSpace a colorspace - * @returns a name - * @see GetColorSpaceForName + * Convert a colorspace enum value into a name such as DeviceRGB + * + * \param eColorSpace a colorspace + * \returns a name + * \see GetColorSpaceForName */ static PdfName GetNameForColorSpace( EPdfColorSpace eColorSpace ); @@ -410,10 +412,9 @@ class PODOFO_API PdfColorGray : public PdfColor { public: - /** Create a new PdfColor object with - * a grayscale value. + /** Create a new PdfColor object with a grayscale value. * - * \param dGray a grayscalue value between 0.0 and 1.0 + * \param dGray a grayscale value between 0.0 and 1.0 */ explicit PdfColorGray( double dGray ); @@ -437,8 +438,7 @@ class PODOFO_API PdfColorRGB : public PdfColor { public: - /** Create a new PdfColor object with - * a RGB color + /** Create a new PdfColor object with an RGB color * * \param dRed the value of the red component, must be between 0.0 and 1.0 * \param dGreen the value of the green component, must be between 0.0 and 1.0 @@ -467,8 +467,7 @@ class PODOFO_API PdfColorCMYK : public PdfColor { public: - /** Create a new PdfColor object with - * a CMYK color + /** Create a new PdfColor object with a CMYK color * * \param dCyan the value of the cyan component, must be between 0.0 and 1.0 * \param dMagenta the value of the magenta component, must be between 0.0 and 1.0 @@ -549,7 +548,7 @@ * * \param sName Name of the separation color * \param sDensity the density value of the separation color - * \param alternateColor the alternate color, must be of typ gray, rgb, cmyk or cie + * \param alternateColor the alternate color, must be of type gray, rgb, cmyk or cie */ PdfColorSeparation( const std::string & sName, double dDensity, const PdfColor & alternateColor ); @@ -575,7 +574,7 @@ public: /** Create a new PdfColor object with - * a CIE-LAB-values + * a CIE-LAB-value * * \param dCieL the value of the L component, must be between 0.0 and 100.0 * \param dCieA the value of the A component, must be between -128.0 and 127.0 Modified: podofo/trunk/src/podofo/base/PdfCompilerCompat.h =================================================================== --- podofo/trunk/src/podofo/base/PdfCompilerCompat.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfCompilerCompat.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -237,7 +237,7 @@ /** * \page PoDoFo PdfCompilerCompat Header * - * <b>PdfCompilerCompat.h</b> gathers up nastyness required for various + * <b>PdfCompilerCompat.h</b> gathers up nastiness required for various * compiler compatibility into a central place. All compiler-specific defines, * wrappers, and the like should be included here and (if necessary) in * PdfCompilerCompat.cpp if they must be visible to public users of the library. Modified: podofo/trunk/src/podofo/base/PdfCompilerCompatPrivate.h =================================================================== --- podofo/trunk/src/podofo/base/PdfCompilerCompatPrivate.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfCompilerCompatPrivate.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -231,7 +231,7 @@ // See: <afx.h> looking for _AFX_NO_DEBUG_CRT #ifdef _MSC_VER #if defined(_DEBUG) && defined(DEFINE_NEW_DEBUG_NEW) - // fuer crtdbg.h und malloc.h + // for crtdbg.h and malloc.h #define _CRTDBG_MAP_ALLOC #include <malloc.h> #include <crtdbg.h> @@ -239,7 +239,7 @@ void operator delete(void* av_Ptr_, const char* ac_File_, int ai_Line); #define DEBUG_NEW new(__FILE__, __LINE__) #define new DEBUG_NEW - // doesnt work: + // doesn't work: // // _NEW_CRT is defined in <xdebug> // // #define new _NEW_CRT #endif // _DEBUG @@ -255,7 +255,7 @@ /** * \page PoDoFo PdfCompilerCompatPrivate Header * - * <b>PdfCompilerCompatPrivate.h</b> gathers up nastyness required for various + * <b>PdfCompilerCompatPrivate.h</b> gathers up nastiness required for various * compiler compatibility into a central place. All compiler-specific defines, * wrappers, and the like should be included here and (if necessary) in * PdfCompilerCompatPrivate.cpp. If the must be visible to library users Modified: podofo/trunk/src/podofo/base/PdfContentsTokenizer.h =================================================================== --- podofo/trunk/src/podofo/base/PdfContentsTokenizer.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfContentsTokenizer.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -77,7 +77,7 @@ /** Construct a PdfContentsTokenizer from a PdfCanvas * (i.e. PdfPage or a PdfXObject). * - * This is more convinient as you do not have + * This is more convenient as you do not have * to care about buffers yourself. * * \param pCanvas an object that hold a PDF contents stream Modified: podofo/trunk/src/podofo/base/PdfData.h =================================================================== --- podofo/trunk/src/podofo/base/PdfData.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfData.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -42,7 +42,7 @@ class PdfOutputDevice; -/** A datatype that allows to write abitrary data +/** A datatype that allows to write arbitrary data * to a PDF file. * The user of this class has to ensure that the data * written to the PDF file using this class is valid data Modified: podofo/trunk/src/podofo/base/PdfDate.h =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfDate.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -39,7 +39,7 @@ #include <ctime> -// a PDF date has a maximum of 26 bytes incuding the terminating \0 +// a PDF date has a maximum of 26 bytes including the terminating \0 #define PDF_DATE_BUFFER_SIZE 26 namespace PoDoFo { @@ -69,7 +69,7 @@ /** Create a PdfDate with a specified date and time * \param t the date and time of this object * - * Use IsValid to check wether the time_t could be + * Use IsValid to check whether the time_t could be * converted to a valid PdfDate object. * * \see IsValid() @@ -82,7 +82,7 @@ * the format (D:YYYYMMDDHHmmSSOHH'mm'). * Otherwise IsValid will return false. * - * Use IsValid to check wether the string could be + * Use IsValid to check whether the string could be * converted to a valid PdfDate object. * * \see IsValid() @@ -93,7 +93,7 @@ */ virtual ~PdfDate(); - /** You can use this function to check wether the date + /** You can use this function to check whether the date * you passed to the constructor could be converted to * a valid pdf date string or a valid time_t. * Modified: podofo/trunk/src/podofo/base/PdfDefines.h =================================================================== --- podofo/trunk/src/podofo/base/PdfDefines.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfDefines.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -90,11 +90,11 @@ /** \def PODOFO_VERBOSE_DEBUG * Debug define. Enable it, if you need - * more debuf output to the commandline from PoDoFo + * more debug output to the command line from PoDoFo * * Setting PDF_VERBOSE_DEBUG will make PoDoFo * EXTREMELY slow and verbose, so it's not practical - * even for regular debuggin. + * even for regular debugging. */ #ifndef PODOFO_VERBOSE_DEBUG //#define PODOFO_VERBOSE_DEBUG @@ -150,7 +150,7 @@ */ namespace PoDoFo { -/* Explicitly big-endian short, suitable for unicode text */ +/* Explicitly big-endian short, suitable for Unicode text */ typedef pdf_uint16 pdf_utf16be; /* Typedef to indicate utf-8 encoded data */ typedef unsigned char pdf_utf8; @@ -158,7 +158,7 @@ // Enums /** - * Enum to identify diferent versions of the PDF file format + * Enum to identify different versions of the PDF file format */ enum EPdfVersion { ePdfVersion_1_0 = 0, /**< PDF 1.0 */ Modified: podofo/trunk/src/podofo/base/PdfDictionary.h =================================================================== --- podofo/trunk/src/podofo/base/PdfDictionary.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfDictionary.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -101,8 +101,8 @@ */ virtual ~PdfDictionary(); - /** Asignment operator. - * Asign another PdfDictionary to this dictionary. This is a deep copy; + /** Assignment operator. + * Assign another PdfDictionary to this dictionary. This is a deep copy; * all elements of the source dictionary are duplicated. * * \param rhs the PdfDictionary to copy. Modified: podofo/trunk/src/podofo/base/PdfEncoding.h =================================================================== --- podofo/trunk/src/podofo/base/PdfEncoding.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfEncoding.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -61,9 +61,9 @@ * Create a new PdfEncoding. * * \param nFirstChar the first supported character code - * (either a byte value in the current encoding or a unicode value) + * (either a byte value in the current encoding or a Unicode value) * \param nLastChar the last supported character code, must be larger than nFirstChar - * (either a byte value in the current encoding or a unicode value) + * (either a byte value in the current encoding or a Unicode value) * */ PdfEncoding( int nFirstChar, int nLastChar, PdfObject* = NULL ); @@ -76,7 +76,7 @@ virtual const PdfName & GetID() const = 0; public: -#if defined(_MSC_VER) && _MSC_VER <= 1200 // ab Visualstudio 6 +#if defined(_MSC_VER) && _MSC_VER <= 1200 // Visual Studio 6 or earlier class PODOFO_API const_iterator : public std::iterator< std::forward_iterator_tag, int, ptrdiff_t> { @@ -158,23 +158,23 @@ virtual void AddToDictionary( PdfDictionary & rDictionary ) const = 0; /** Convert a string that is encoded with this encoding - * to an unicode PdfString. + * to a Unicode PdfString. * * \param rEncodedString a string encoded by this encoding. * Usually this string was read from a content stream. * \param pFont the font for which this string is converted * - * \returns an unicode PdfString. + * \returns a Unicode PdfString. */ virtual PdfString ConvertToUnicode( const PdfString & rEncodedString, const PdfFont* pFont ) const; - /** Convert a unicode PdfString to a string encoded with this encoding. + /** Convert a Unicode PdfString to a string encoded with this encoding. * - * \param rString an unicode PdfString. + * \param rString a Unicode PdfString. * \param pFont the font for which this string is converted * * \returns an encoded PdfRefCountedBuffer. The PdfRefCountedBuffer is treated as a series of bytes - * and is allowed to have 0 bytes. The returned buffer must not be a unicode string. + * and is allowed to have 0 bytes. The returned buffer must not be a Unicode string. */ virtual PdfRefCountedBuffer ConvertToEncoding( const PdfString & rString, const PdfFont* pFont ) const; @@ -192,14 +192,14 @@ */ inline int GetLastChar() const; - /** Iterate over all unicode character points in this + /** Iterate over all Unicode character points in this * encoding, beginning with the first. * - * \returns iterator pointing to the first defined unicode character + * \returns iterator pointing to the first defined Unicode character */ inline const_iterator begin() const; - /** Iterate over all unicode character points in this + /** Iterate over all Unicode character points in this * encoding, beginning with the first. * * \returns iterator pointing at the end @@ -206,12 +206,12 @@ */ inline const_iterator end() const; - /** Get the unicode character code for this encoding + /** Get the Unicode character code for this encoding * at the position nIndex. nIndex is a position between * GetFirstChar() and GetLastChar() * * \param nIndex character code at position index - * \returns unicode character code + * \returns Unicode character code * * \see GetFirstChar * \see GetLastChar @@ -221,7 +221,7 @@ virtual pdf_utf16be GetCharCode( int nIndex ) const = 0; protected: - bool m_bToUnicodeIsLoaded; ///< If true, ToUnicode has been parse + bool m_bToUnicodeIsLoaded; ///< If true, ToUnicode has been parsed private: int m_nFirstChar; ///< The first defined character code @@ -331,7 +331,7 @@ * \see PdfZapfDingbatsEncoding * * This will allocate a table of 65535 short values - * to make conversion from unicode to encoded strings + * to make conversion from Unicode to encoded strings * faster. As this requires a lot of memory, make sure that * only one object of a certain encoding exists at one * time, which is no problem as all methods are const anyways! @@ -349,28 +349,28 @@ virtual void AddToDictionary( PdfDictionary & rDictionary ) const; /** Convert a string that is encoded with this encoding - * to an unicode PdfString. + * to a Unicode PdfString. * * \param rEncodedString a string encoded by this encoding. * Usually this string was read from a content stream. * \param pFont the font for which this string is converted * - * \returns an unicode PdfString. + * \returns a Unicode PdfString. */ virtual PdfString ConvertToUnicode( const PdfString & rEncodedString, const PdfFont* pFont ) const; - /** Convert a unicode PdfString to a string encoded with this encoding. + /** Convert a Unicode PdfString to a string encoded with this encoding. * - * \param rString an unicode PdfString. + * \param rString a Unicode PdfString. * \param pFont the font for which this string is converted * * \returns an encoded PdfRefCountedBuffer. The PdfRefCountedBuffer is treated as a series of bytes - * and is allowed to have 0 bytes. The returned buffer must not be a unicode string. + * and is allowed to have 0 bytes. The returned buffer must not be a Unicode string. */ virtual PdfRefCountedBuffer ConvertToEncoding( const PdfString & rString, const PdfFont* pFont ) const; /** - * PdfSimpleEncoding subclasses are usuylla not auto-deleted, as + * PdfSimpleEncoding subclasses are usually not auto-deleted, as * they are allocated statically only once. * * \returns true if this encoding should be deleted automatically with the @@ -392,12 +392,12 @@ */ inline const PdfName & GetName() const; - /** Get the unicode character code for this encoding + /** Get the Unicode character code for this encoding * at the position nIndex. nIndex is a position between * GetFirstChar() and GetLastChar() * * \param nIndex character code at position index - * \returns unicode character code + * \returns Unicode character code * * \see GetFirstChar * \see GetLastChar @@ -409,7 +409,7 @@ char GetUnicodeCharCode(pdf_utf16be unicodeValue) const; private: - /** Initialize the internal table of mappings from unicode code points + /** Initialize the internal table of mappings from Unicode code points * to encoded byte values. */ void InitEncodingTable(); @@ -424,13 +424,13 @@ inline virtual const PdfName & GetID() const; /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const = 0; @@ -498,13 +498,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -541,13 +541,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -556,7 +556,7 @@ * * This method generates array of differences into /Encoding * dictionary if called from derived class with - * different unicode table. + * different Unicode table. * * \param rDictionary add the encoding to this dictionary */ @@ -587,13 +587,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -618,13 +618,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -633,7 +633,7 @@ }; -// OC 13.08.2010 Neu: StandardEncoding +// OC 13.08.2010 New: StandardEncoding /** * Do not allocate this class yourself, as allocations * might be expensive. Try using PdfFont::StandardEncoding. @@ -654,13 +654,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -669,7 +669,7 @@ }; -// OC 13.08.2010 Neu: SymbolEncoding +// OC 13.08.2010 New: SymbolEncoding /** * Do not allocate this class yourself, as allocations * might be expensive. Try using PdfFont::SymbolEncoding. @@ -690,13 +690,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -705,7 +705,7 @@ }; -// OC 13.08.2010 Neu: ZapfDingbatsEncoding +// OC 13.08.2010 New: ZapfDingbatsEncoding /** * Do not allocate this class yourself, as allocations * might be expensive. Try using PdfFont::ZapfDingbats. @@ -726,13 +726,13 @@ protected: /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -763,13 +763,13 @@ } /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; @@ -800,13 +800,13 @@ } /** Gets a table of 256 short values which are the - * big endian unicode code points that are assigned + * big endian Unicode code points that are assigned * to the 256 values of this encoding. * * This table is used internally to convert an encoded - * string of this encoding to and from unicode. + * string of this encoding to and from Unicode. * - * \returns an array of 256 big endian unicode code points + * \returns an array of 256 big endian Unicode code points */ virtual const pdf_utf16be* GetToUnicodeTable() const; Modified: podofo/trunk/src/podofo/base/PdfEncodingFactory.h =================================================================== --- podofo/trunk/src/podofo/base/PdfEncodingFactory.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfEncodingFactory.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -139,7 +139,7 @@ static const PdfEncoding* GlobalIso88592EncodingInstance(); /** Free's the memory allocated by - * the global encoding instancess in this singleton. + * the global encoding instances in this singleton. * * PoDoFo will reallocated these encodings as soon * as they are needed again. Modified: podofo/trunk/src/podofo/base/PdfEncrypt.h =================================================================== --- podofo/trunk/src/podofo/base/PdfEncrypt.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfEncrypt.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -66,13 +66,13 @@ /** A class that is used to encrypt a PDF file and - * set document permisions on the PDF file. + * set document permissions on the PDF file. * - * As a user of this class, you have only to instanciate a + * As a user of this class, you have only to instantiate a * object of this class and pass it to PdfWriter, PdfMemDocument, * PdfStreamedDocument or PdfImmediateWriter. * You do not have to call any other method of this class. The above - * classes know how to handle encryption using Pdfencrypt. + * classes know how to handle encryption using PdfEncrypt. * */ class PODOFO_API PdfEncrypt @@ -100,11 +100,11 @@ */ typedef enum { ePdfPermissions_Print = 0x00000004, ///< Allow printing the document - ePdfPermissions_Edit = 0x00000008, ///< Allow modifying the document besides annotations, form fields or chaning pages + ePdfPermissions_Edit = 0x00000008, ///< Allow modifying the document besides annotations, form fields or changing pages ePdfPermissions_Copy = 0x00000010, ///< Allow text and graphic extraction - ePdfPermissions_EditNotes = 0x00000020, ///< Add or modify text annoations or form fields (if ePdfPermissions_Edit is set also allow to create interactive form fields including signature) + ePdfPermissions_EditNotes = 0x00000020, ///< Add or modify text annotations or form fields (if ePdfPermissions_Edit is set also allow to create interactive form fields including signature) ePdfPermissions_FillAndSign = 0x00000100, ///< Fill in existing form or signature fields - ePdfPermissions_Accessible = 0x00000200, ///< Extract text and graphics to support user with disabillities + ePdfPermissions_Accessible = 0x00000200, ///< Extract text and graphics to support user with disabilities ePdfPermissions_DocAssembly = 0x00000400, ///< Assemble the document: insert, create, rotate delete pages or add bookmarks ePdfPermissions_HighPrint = 0x00000800 ///< Print a high resolution version of the document } EPdfPermissions; @@ -173,7 +173,7 @@ * Retrieve the list of encryption algorithms that are used * when loading a PDF document. * - * By default all alogrithms are enabled. + * By default all algorithms are enabled. * * \see IsEncryptionEnabled * \see SetEnabledEncryptionAlgorithms @@ -197,7 +197,7 @@ /** * Test if a certain encryption algorithm is enabled for loading PDF documents. * - * \returns ture if the encryption algorithm is enabled + * \returns true if the encryption algorithm is enabled * \see GetEnabledEncryptionAlgorithms * \see SetEnabledEncryptionAlgorithms */ @@ -231,7 +231,7 @@ * \param pOutputStream the created PdfOutputStream writes all encrypted * data to this output stream. * - * \returns a PdfOutputStream that encryts all data. + * \returns a PdfOutputStream that encrypts all data. */ virtual PdfOutputStream* CreateEncryptionOutputStream( PdfOutputStream* pOutputStream ) = 0; @@ -271,10 +271,10 @@ */ inline bool IsPrintAllowed() const; - /** Checks if modifiying this document (besides annotations, form fields or changing pages) is allowed. + /** Checks if modifying this document (besides annotations, form fields or changing pages) is allowed. * Every PDF consuming applications has to adhere this value! * - * \returns true if you are allowed to modfiy this document + * \returns true if you are allowed to modify this document * * \see PdfEncrypt to set own document permissions. */ @@ -307,10 +307,10 @@ */ inline bool IsFillAndSignAllowed() const; - /** Checks if it is allowed to extract text and graphics to support users with disabillities + /** Checks if it is allowed to extract text and graphics to support users with disabilities * Every PDF consuming applications has to adhere this value! * - * \returns true if you are allowed to extract text and graphics to support users with disabillities + * \returns true if you are allowed to extract text and graphics to support users with disabilities * * \see PdfEncrypt to set own document permissions. */ Modified: podofo/trunk/src/podofo/base/PdfError.h =================================================================== --- podofo/trunk/src/podofo/base/PdfError.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfError.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -242,9 +242,9 @@ /** Create a PdfError object with a given error code. * \param eCode the error code of this object - * \param pszFile the file in which the error has occured. + * \param pszFile the file in which the error has occurred. * Use the compiler macro __FILE__ to initialize the field. - * \param line the line in which the error has occured. + * \param line the line in which the error has occurred. * Use the compiler macro __LINE__ to initialize the field. * \param pszInformation additional information on this error */ @@ -253,9 +253,9 @@ /** Create a PdfError object with a given error code. * \param eCode the error code of this object - * \param pszFile the file in which the error has occured. + * \param pszFile the file in which the error has occurred. * Use the compiler macro __FILE__ to initialize the field. - * \param line the line in which the error has occured. + * \param line the line in which the error has occurred. * Use the compiler macro __LINE__ to initialize the field. * \param sInformation additional information on this error */ Modified: podofo/trunk/src/podofo/base/PdfFiltersPrivate.h =================================================================== --- podofo/trunk/src/podofo/base/PdfFiltersPrivate.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfFiltersPrivate.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -97,7 +97,7 @@ virtual ~PdfHexFilter() { } - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -119,7 +119,7 @@ */ virtual void EncodeBlockImpl( const char* pBuffer, pdf_long lLen ); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ @@ -205,7 +205,7 @@ PdfAscii85Filter(); virtual ~PdfAscii85Filter() { } - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -243,7 +243,7 @@ */ virtual void EndEncodeImpl(); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ @@ -333,7 +333,7 @@ PdfFlateFilter(); virtual ~PdfFlateFilter(); - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -371,7 +371,7 @@ */ virtual void EndEncodeImpl(); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ @@ -466,7 +466,7 @@ PdfRLEFilter(); virtual ~PdfRLEFilter() {} - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -498,7 +498,7 @@ */ virtual void EndEncodeImpl(); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ @@ -581,7 +581,7 @@ virtual ~PdfLZWFilter(); - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -619,7 +619,7 @@ */ virtual void EndEncodeImpl(); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ @@ -735,7 +735,7 @@ virtual ~PdfDCTFilter(); - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -773,7 +773,7 @@ */ virtual void EndEncodeImpl(); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ @@ -868,7 +868,7 @@ virtual ~PdfCCITTFilter(); - /** Check wether the encoding is implemented for this filter. + /** Check whether the encoding is implemented for this filter. * * \returns true if the filter is able to encode data */ @@ -906,7 +906,7 @@ */ virtual void EndEncodeImpl(); - /** Check wether the decoding is implemented for this filter. + /** Check whether the decoding is implemented for this filter. * * \returns true if the filter is able to decode data */ Modified: podofo/trunk/src/podofo/base/PdfImmediateWriter.h =================================================================== --- podofo/trunk/src/podofo/base/PdfImmediateWriter.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfImmediateWriter.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -75,7 +75,7 @@ ~PdfImmediateWriter(); - /** Get the write mode used for wirting the PDF + /** Get the write mode used for writing the PDF * \returns the write mode */ inline EPdfWriteMode GetWriteMode() const; Modified: podofo/trunk/src/podofo/base/PdfInputDevice.h =================================================================== --- podofo/trunk/src/podofo/base/PdfInputDevice.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfInputDevice.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -48,7 +48,7 @@ * * This class is suitable for inheritance to provide input * devices of your own for PoDoFo. - * Just overide the required virtual methods. + * Just override the required virtual methods. */ class PODOFO_API PdfInputDevice { public: @@ -67,7 +67,7 @@ * is read from this file. * * This is an overloaded member function to allow working - * with unicode characters. On Unix systes you can also path + * with Unicode characters. On Unix systems you can also path * UTF-8 to the const char* overload. */ PdfInputDevice( const wchar_t* pszFilename ); @@ -112,7 +112,7 @@ */ virtual int Look() const; - /** Seek the device to the position offset from the begining + /** Seek the device to the position offset from the beginning * \param off from the beginning of the file * \param dir where to start (start, cur, end) * @@ -126,7 +126,7 @@ * The buffer has to be large enough. * \param lLen number of bytes to read. * \returns the number of bytes that have been read. - * If reading was successfull the number of read bytes + * If reading was successful the number of read bytes * is equal to lLen. */ virtual std::streamoff Read( char* pBuffer, std::streamsize lLen ); Modified: podofo/trunk/src/podofo/base/PdfInputStream.h =================================================================== --- podofo/trunk/src/podofo/base/PdfInputStream.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfInputStream.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -55,7 +55,7 @@ * that will be read * \param pTotalLeft total bytes left (needed for AES IV and padding) * - * \returns the number of bytes read, -1 if an error ocurred + * \returns the number of bytes read, -1 if an error occurred * and zero if no more bytes are available for reading. */ virtual pdf_long Read( char* pBuffer, pdf_long lLen, pdf_long *pTotalLeft = 0 ) = 0; @@ -79,7 +79,7 @@ * \param pszFilename the filename of the file to read * * This is an overloaded member function to allow working - * with unicode characters. On Unix systes you can also path + * with Unicode characters. On Unix systems you can also path * UTF-8 to the const char* overload. */ PdfFileInputStream( const wchar_t* pszFilename ); @@ -93,7 +93,7 @@ * \param lLen the size of the buffer and number of bytes * that will be read * - * \returns the number of bytes read, -1 if an error ocurred + * \returns the number of bytes read, -1 if an error occurred * and zero if no more bytes are available for reading. */ virtual pdf_long Read( char* pBuffer, pdf_long lLen, pdf_long* = 0 ); @@ -131,7 +131,7 @@ * \param lLen the size of the buffer and number of bytes * that will be read * - * \returns the number of bytes read, -1 if an error ocurred + * \returns the number of bytes read, -1 if an error occurred * and zero if no more bytes are available for reading. */ virtual pdf_long Read( char* pBuffer, pdf_long lLen, pdf_long* ); @@ -148,7 +148,7 @@ public: /** - * Read from an alread opened input device + * Read from an already opened input device * * \param pDevice an input device */ @@ -161,7 +161,7 @@ * \param lLen the size of the buffer and number of bytes * that will be read * - * \returns the number of bytes read, -1 if an error ocurred + * \returns the number of bytes read, -1 if an error occurred * and zero if no more bytes are available for reading. */ virtual pdf_long Read( char* pBuffer, pdf_long lLen, pdf_long* ); Modified: podofo/trunk/src/podofo/base/PdfLocale.h =================================================================== --- podofo/trunk/src/podofo/base/PdfLocale.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfLocale.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -50,7 +50,7 @@ * PDF document structure I/O is done with the C++ standard library * IOStreams code. By default, this will adapt to the current locale. * That's not good at all when doing I/O of PDF data structures, which - * follow POSIX/english locale conventions irrespective of runtime locale. + * follow POSIX/English locale conventions irrespective of runtime locale. * Make sure to to call this function on any stream you intend to use for * PDF I/O. Avoid using this stream for anything that should be done in the * regional locale. Modified: podofo/trunk/src/podofo/base/PdfMemStream.h =================================================================== --- podofo/trunk/src/podofo/base/PdfMemStream.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfMemStream.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -47,7 +47,7 @@ class PdfObject; /** A PDF stream can be appended to any PdfObject - * and can contain abitrary data. + * and can contain arbitrary data. * * A PDF memory stream is held completely in memory. * @@ -132,7 +132,7 @@ */ void Uncompress(); - /** Empty's the stream and set the streams buffer size to 0 + /** Empties the stream and set the streams buffer size to 0 */ void Empty(); Modified: podofo/trunk/src/podofo/base/PdfName.h =================================================================== --- podofo/trunk/src/podofo/base/PdfName.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfName.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -162,7 +162,7 @@ */ PODOFO_NOTHROW inline bool operator==( const PdfName & rhs ) const; - /** overloaded operator for convinience + /** overloaded operator for convenience * * The string argument is treated as an unescaped name. * @@ -171,7 +171,7 @@ */ bool operator==( const char* rhs ) const; - /** overloaded operator for convinience + /** overloaded operator for convenience * * The string argument is treated as an unescaped name. * @@ -185,7 +185,7 @@ */ PODOFO_NOTHROW inline bool operator!=( const PdfName & rhs ) const; - /** overloaded operator for convinience + /** overloaded operator for convenience * * The string argument is treated as an unescaped name. * Modified: podofo/trunk/src/podofo/base/PdfObjectStreamParserObject.h =================================================================== --- podofo/trunk/src/podofo/base/PdfObjectStreamParserObject.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfObjectStreamParserObject.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -58,7 +58,7 @@ * All objects from the object stream will be read into memory. * * \param pParser PdfParserObject for an object stream - * \param pVecObjects add loaded objecs to this vector of objects + * \param pVecObjects add loaded objects to this vector of objects * \param rBuffer use this allocated buffer for caching */ PdfObjectStreamParserObject(PdfParserObject* pParser, PdfVecObjects* pVecObjects, const PdfRefCountedBuffer & rBuffer); Modified: podofo/trunk/src/podofo/base/PdfOutputDevice.h =================================================================== --- podofo/trunk/src/podofo/base/PdfOutputDevice.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfOutputDevice.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -51,7 +51,7 @@ * * This class is suitable for inheritance to provide output * devices of your own for PoDoFo. - * Just overide the required virtual methods. + * Just override the required virtual methods. */ class PODOFO_API PdfOutputDevice { public: @@ -88,7 +88,7 @@ * to the end of the file. * * This is an overloaded member function to allow working - * with unicode characters. On Unix systes you can also path + * with Unicode characters. On Unix systems you can also path * UTF-8 to the const char* overload. */ PdfOutputDevice( const wchar_t* pszFilename, bool bTruncate = true ); @@ -195,7 +195,7 @@ */ virtual size_t Read( char* pBuffer, size_t lLen ); - /** Seek the device to the position offset from the begining + /** Seek the device to the position offset from the beginning * \param offset from the beginning of the file */ virtual void Seek( size_t offset ); Modified: podofo/trunk/src/podofo/base/PdfOutputStream.h =================================================================== --- podofo/trunk/src/podofo/base/PdfOutputStream.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfOutputStream.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -58,7 +58,7 @@ * \param pBuffer the data is read from this buffer * \param lLen the size of the buffer * - * \returns the number of bytes written, -1 if an error ocurred + * \returns the number of bytes written, -1 if an error occurred */ virtual pdf_long Write( const char* pBuffer, pdf_long lLen ) = 0; @@ -69,7 +69,7 @@ /** Close the PdfOutputStream. * This method may throw exceptions and has to be called - * before the descructor to end writing. + * before the destructor to end writing. * * No more data may be written to the output device * after calling close. @@ -100,13 +100,13 @@ * \param pBuffer the data is read from this buffer * \param lLen the size of the buffer * - * \returns the number of bytes written, -1 if an error ocurred + * \returns the number of bytes written, -1 if an error occurred */ virtual pdf_long Write( const char* pBuffer, pdf_long lLen ); /** Close the PdfOutputStream. * This method may throw exceptions and has to be called - * before the descructor to end writing. + * before the destructor to end writing. * * No more data may be written to the output device * after calling close. @@ -145,13 +145,13 @@ * \param pBuffer the data is read from this buffer * \param lLen the size of the buffer * - * \returns the number of bytes written, -1 if an error ocurred + * \returns the number of bytes written, -1 if an error occurred */ virtual pdf_long Write( const char* pBuffer, pdf_long lLen ); /** Close the PdfOutputStream. * This method may throw exceptions and has to be called - * before the descructor to end writing. + * before the destructor to end writing. * * No more data may be written to the output device * after calling close. @@ -217,13 +217,13 @@ * \param pBuffer the data is read from this buffer * \param lLen the size of the buffer * - * \returns the number of bytes written, -1 if an error ocurred + * \returns the number of bytes written, -1 if an error occurred */ virtual pdf_long Write( const char* pBuffer, pdf_long lLen ); /** Close the PdfOutputStream. * This method may throw exceptions and has to be called - * before the descructor to end writing. + * before the destructor to end writing. * * No more data may be written to the output device * after calling close. @@ -256,7 +256,7 @@ * \param pBuffer the data is read from this buffer * \param lLen the size of the buffer * - * \returns the number of bytes written, -1 if an error ocurred + * \returns the number of bytes written, -1 if an error occurred */ virtual pdf_long Write( const char* pBuffer, pdf_long lLen ); Modified: podofo/trunk/src/podofo/base/PdfParser.h =================================================================== --- podofo/trunk/src/podofo/base/PdfParser.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfParser.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -119,7 +119,7 @@ * Call SetPassword() with the correct password in this case. * * This is an overloaded member function to allow working - * with unicode characters. On Unix systems you can also pass + * with Unicode characters. On Unix systems you can also pass * UTF-8 to the const char* overload. * * \see SetPassword @@ -195,7 +195,7 @@ * * \param pszFilename filename of the file which is going to be parsed * \param bLoadOnDemand If true all objects will be read from the file at - * the time they are accesed first. + * the time they are accessed first. * If false all objects will be read immediately. * This is faster if you do not need the complete PDF * file in memory. @@ -206,7 +206,7 @@ * Call SetPassword with the correct password in this case. * * This is an overloaded member function to allow working - * with unicode characters. On Unix systes you can also path + * with Unicode characters. On Unix systems you can also path * UTF-8 to the const char* overload. * * \see SetPassword @@ -413,7 +413,7 @@ * * \param pszToken a token to find * \param lRange range in bytes in which to search - * begining at the end of the file + * beginning at the end of the file */ void FindToken( const char* pszToken, const long lRange ); @@ -424,7 +424,7 @@ * * \param pszToken a token to find * \param lRange range in bytes in which to search - * begining at the specified position of the file + * beginning at the specified position of the file * \param searchEnd specifies position */ void FindToken2( const char* pszToken, const long lRange, size_t searchEnd ); @@ -435,8 +435,8 @@ */ void ReadDocumentStructure(); - /** Checks wether this pdf is linearized or not. - * Initializes the linearization directory on sucess. + /** Checks whether this pdf is linearized or not. + * Initializes the linearization directory on success. */ void HasLinearizationDict(); @@ -477,7 +477,7 @@ */ void ReadXRefSubsection( pdf_int64 & nFirstObject, pdf_int64 & nNumObjects ); - /** Reads a xref stream contens object + /** Reads an XRef stream contents object * \param lOffset read the stream from this offset * \param bReadOnlyTrailer only the trailer is skipped over, the contents * of the xref stream are not parsed Modified: podofo/trunk/src/podofo/base/PdfParserObject.h =================================================================== --- podofo/trunk/src/podofo/base/PdfParserObject.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfParserObject.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -83,7 +83,7 @@ * \param pEncrypt an encryption dictionary which is used to decrypt * strings and streams during parsing or NULL if the PDF * file was not encrypted - * \param bIsTrailer wether this is a trailer dictionary or not. + * \param bIsTrailer whether this is a trailer dictionary or not. * trailer dictionaries do not have a object number etc. */ void ParseFile( PdfEncrypt* pEncrypt, bool bIsTrailer = false ); @@ -101,7 +101,7 @@ */ inline bool IsLoadOnDemand() const; - /** Sets wether this object shall be loaded on demand + /** Sets whether this object shall be loaded on demand * when it's data is accessed for the first time. * \param bDelayed if true the object is loaded delayed. */ @@ -167,7 +167,7 @@ void InitPdfParserObject(); /** Parse the object data from the given file handle - * \param bIsTrailer wether this is a trailer dictionary or not. + * \param bIsTrailer whether this is a trailer dictionary or not. * trailer dictionaries do not have a object number etc. */ void ParseFileComplete( bool bIsTrailer ); Modified: podofo/trunk/src/podofo/base/PdfRefCountedBuffer.h =================================================================== --- podofo/trunk/src/podofo/base/PdfRefCountedBuffer.h 2021-01-24 11:34:29 UTC (rev 2033) +++ podofo/trunk/src/podofo/base/PdfRefCountedBuffer.h 2021-07-18 09:29:17 UTC (rev 2034) @@ -41,7 +41,7 @@ /** * A reference counted buffer object * which is deleted as soon as the last - * object having access to it is delteted. + * object having access to it is deleted. * * The attached memory object can be resized. */ @@ -48,7 +48,7 @@ class PODOFO_API PdfRefCountedBuffer { public: /** Created an empty reference counted buffer - * The buffer will be initialize to NULL + * The buffer will be initialized to NULL */ inline PdfRefCountedBuffer(); @@ -105,7 +105,7 @@ * lSize bytes. * * \param lSize the size of bytes the buffer can at least hold - * + * * If the buffer is la... [truncated message content] |
From: <dom...@us...> - 2021-01-24 11:34:31
|
Revision: 2033 http://sourceforge.net/p/podofo/code/2033 Author: domseichter Date: 2021-01-24 11:34:29 +0000 (Sun, 24 Jan 2021) Log Message: ----------- PATCH: Patch by Chris: Handle the Name datatype correctly. Without this fix the Name datatype got converted to a dictionary after imposing the PDF. This resulted in having an invalid /ColorSpace for images and thus images that did not show up in the resulting PDF. Modified Paths: -------------- podofo/trunk/tools/podofoimpose/pdftranslator.cpp Modified: podofo/trunk/tools/podofoimpose/pdftranslator.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/pdftranslator.cpp 2021-01-24 11:33:56 UTC (rev 2032) +++ podofo/trunk/tools/podofoimpose/pdftranslator.cpp 2021-01-24 11:34:29 UTC (rev 2033) @@ -281,6 +281,10 @@ else return NULL; // avoid going through rest of method } + else if ( obj->IsName() ) + { + ret = targetDoc->GetObjects().CreateObject(obj->GetName()); + } else { ret = new PdfObject ( *obj );//targetDoc->GetObjects().CreateObject(*obj); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-24 11:33:58
|
Revision: 2032 http://sourceforge.net/p/podofo/code/2032 Author: domseichter Date: 2021-01-24 11:33:56 +0000 (Sun, 24 Jan 2021) Log Message: ----------- PATCH: Patch by Chris: With this change it is possible to scale an inserted page (one by one with different scaling). I tried to make sure, that all additional parameters are optional and the previous behavior is retained if no scaling factors are given. Modified Paths: -------------- podofo/trunk/tools/podofoimpose/impositionplan.cpp podofo/trunk/tools/podofoimpose/impositionplan.h podofo/trunk/tools/podofoimpose/pdftranslator.cpp podofo/trunk/tools/podofoimpose/pdftranslator.h podofo/trunk/tools/podofoimpose/planreader_lua.cpp Modified: podofo/trunk/tools/podofoimpose/impositionplan.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/impositionplan.cpp 2021-01-24 11:33:12 UTC (rev 2031) +++ podofo/trunk/tools/podofoimpose/impositionplan.cpp 2021-01-24 11:33:56 UTC (rev 2032) @@ -42,12 +42,14 @@ #include <iostream> //XXX namespace PoDoFo { namespace Impose { -PageRecord::PageRecord ( int s,int d,double r, double tx, double ty, int du ) +PageRecord::PageRecord ( int s,int d,double r, double tx, double ty, int du, double sx, double sy ) : sourcePage ( s ), destPage ( d ), rotate ( r ), transX ( tx ), transY ( ty ), + scaleX ( sx ), + scaleY ( sy ), duplicateOf( du ) { }; @@ -58,6 +60,8 @@ rotate ( 0 ), transX ( 0 ), transY ( 0 ), + scaleX ( 1 ), + scaleY ( 1 ), duplicateOf( 0 ) {}; @@ -80,7 +84,7 @@ ts += ci; } - if ( tokens.size() != 5 ) + if ( tokens.size() != 5 && tokens.size() != 7 ) { sourcePage = destPage = 0; // will return false for isValid() std::cerr<<"INVALID_RECORD("<< tokens.size() <<") "<<buffer<<std::endl; @@ -98,8 +102,14 @@ rotate = calc ( tokens.at ( 2 ) , vars); transX = calc ( tokens.at ( 3 ) , vars); transY = calc ( tokens.at ( 4 ) , vars); + if (tokens.size() == 7) { + scaleX = calc ( tokens.at ( 5 ) , vars); + scaleY = calc ( tokens.at ( 6 ) , vars); + } else { + scaleX = scaleY = 1.0; + } - std::cerr<<" "<<sourcePage<<" "<<destPage<<" "<<rotate<<" "<<transX<<" "<<transY <<std::endl; + std::cerr<<" "<<sourcePage<<" "<<destPage<<" "<<rotate<<" "<<transX<<" "<<transY<<" "<<scaleX<<" "<<scaleY <<std::endl; } Modified: podofo/trunk/tools/podofoimpose/impositionplan.h =================================================================== --- podofo/trunk/tools/podofoimpose/impositionplan.h 2021-01-24 11:33:12 UTC (rev 2031) +++ podofo/trunk/tools/podofoimpose/impositionplan.h 2021-01-24 11:33:56 UTC (rev 2032) @@ -81,7 +81,7 @@ class PageRecord { public: - PageRecord ( int s,int d,double r, double tx, double ty , int du = 0 ); + PageRecord ( int s,int d,double r, double tx, double ty , int du = 0, double sx = 1.0, double sy = 1.0 ); PageRecord( ); ~PageRecord() {}; int sourcePage; @@ -89,6 +89,8 @@ double rotate; double transX; double transY; + double scaleX; + double scaleY; int duplicateOf; bool isValid() const; Modified: podofo/trunk/tools/podofoimpose/pdftranslator.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/pdftranslator.cpp 2021-01-24 11:33:12 UTC (rev 2031) +++ podofo/trunk/tools/podofoimpose/pdftranslator.cpp 2021-01-24 11:33:56 UTC (rev 2032) @@ -431,6 +431,59 @@ // delete sourceDoc; } + void PdfTranslator::transform(double a, double b, double c, double d, double e, double f) + { + if (transformMatrix.empty()) { + transformMatrix.push_back(a); + transformMatrix.push_back(b); + transformMatrix.push_back(c); + transformMatrix.push_back(d); + transformMatrix.push_back(e); + transformMatrix.push_back(f); + + } else { + std::vector<double> m0 = transformMatrix; + std::vector<double> m; + + m.push_back(m0.at(0)*a + m0.at(1)*c); + m.push_back(m0.at(0)*b + m0.at(1)*d); + m.push_back(m0.at(2)*a + m0.at(3)*c); + m.push_back(m0.at(2)*b + m0.at(3)*d); + + m.push_back(m0.at(4)*a + m0.at(5)*c + e); + m.push_back(m0.at(4)*b + m0.at(5)*d + f); + + transformMatrix = m; + } + } + + void PdfTranslator::rotate_and_translate(double theta, double dx, double dy) + { + double cosR = cos ( theta * 3.14159 / 180.0 ); + double sinR = sin ( theta * 3.14159 / 180.0 ); + transform(cosR, sinR, -sinR, cosR, dx, dy); + } + + void PdfTranslator::translate(double dx, double dy) + { + transform(1, 0, 0, 1, dx, dy); + } + + void PdfTranslator::scale(double sx, double sy) + { + transform(sx, 0, 0, sy, 0, 0); + } + + void PdfTranslator::rotate(double theta) + { + double cosR = cos ( theta * 3.14159 / 180.0 ); + double sinR = sin ( theta * 3.14159 / 180.0 ); + // Counter-clockwise rotation (default): + transform(cosR, sinR, -sinR, cosR, 0, 0); + // Clockwise rotation: + // transform(cosR, -sinR, sinR, cosR, 0, 0); + } + void PdfTranslator::loadPlan ( const std::string & planFile , PoDoFo::Impose::PlanReader loader ) { // std::cerr<< "loadPlan" << planFile<<std::endl; @@ -524,10 +577,11 @@ // std::cerr<<curRecord.sourcePage<< " " << curRecord.destPage<<std::endl; if(curRecord.sourcePage <= pcount) { - double cosR = cos ( curRecord.rotate * 3.14159 / 180.0 ); - double sinR = sin ( curRecord.rotate * 3.14159 / 180.0 ); + double rot = curRecord.rotate; double tx = curRecord.transX ; double ty = curRecord.transY ; + double sx = curRecord.scaleX ; + double sy = curRecord.scaleY ; int resourceIndex ( /*(curRecord.duplicateOf > 0) ? curRecord.duplicateOf : */curRecord.sourcePage ); PdfXObject *xo = xobjects[resourceIndex]; @@ -563,9 +617,18 @@ std::cerr<<"ERROR Unknown type resource "<<resources[resourceIndex]->GetDataTypeString() << std::endl; } + // Make sure we start with an empty transformMatrix. + transformMatrix.clear(); + translate(0, 0); + // 1. Rotate, 2. Translate, 3. Scale + if (rot != 0 || tx != 0 || ty != 0) { + rotate_and_translate(rot, tx, ty); + } + scale(sx, sy); + // Very primitive but it makes it easy to track down imposition plan into content stream. buffer << "q\n"; - buffer << std::fixed << cosR <<" "<< sinR<<" "<<-sinR<<" "<< cosR<<" "<< tx <<" "<< ty << " cm\n"; + buffer << std::fixed << transformMatrix[0] <<" "<< transformMatrix[1] <<" "<< transformMatrix[2] <<" "<< transformMatrix[3] <<" "<< transformMatrix[4] <<" "<< transformMatrix[5] << " cm\n"; buffer << "/OriginalPage" << resourceIndex << " Do\n"; buffer << "Q\n"; } Modified: podofo/trunk/tools/podofoimpose/pdftranslator.h =================================================================== --- podofo/trunk/tools/podofoimpose/pdftranslator.h 2021-01-24 11:33:12 UTC (rev 2031) +++ podofo/trunk/tools/podofoimpose/pdftranslator.h 2021-01-24 11:33:56 UTC (rev 2032) @@ -133,6 +133,13 @@ std::map<std::string, PdfObject*> migrateMap; std::set<PdfObject*> setMigrationPending; + + std::vector<double> transformMatrix; + void transform(double a, double b, double c, double d, double e, double f); + void translate(double dx, double dy); + void scale(double sx, double sy); + void rotate(double theta); + void rotate_and_translate(double theta, double dx, double dy); public: int pcount; double sourceWidth; Modified: podofo/trunk/tools/podofoimpose/planreader_lua.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/planreader_lua.cpp 2021-01-24 11:33:12 UTC (rev 2031) +++ podofo/trunk/tools/podofoimpose/planreader_lua.cpp 2021-01-24 11:33:56 UTC (rev 2032) @@ -111,6 +111,12 @@ lua_tonumber ( L, 3 ), lua_tonumber ( L, 4 ), lua_tonumber ( L, 5 )); + + if (lua_isnumber ( L, 6 )) + P.scaleX = lua_tonumber ( L, 6 ); + if (lua_isnumber ( L, 7 )) + P.scaleY = lua_tonumber ( L, 7 ); + if(P.isValid()) that->plan->push_back ( P ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-24 11:33:15
|
Revision: 2031 http://sourceforge.net/p/podofo/code/2031 Author: domseichter Date: 2021-01-24 11:33:12 +0000 (Sun, 24 Jan 2021) Log Message: ----------- PATCH: Patch by Chris: If an exception happens, return none zero return code. Modified Paths: -------------- podofo/trunk/tools/podofoimpose/podofoimpose.cpp Modified: podofo/trunk/tools/podofoimpose/podofoimpose.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/podofoimpose.cpp 2021-01-24 11:31:56 UTC (rev 2030) +++ podofo/trunk/tools/podofoimpose/podofoimpose.cpp 2021-01-24 11:33:12 UTC (rev 2031) @@ -119,6 +119,7 @@ catch ( std::exception & e ) { cerr << e.what() << endl; + return 4; } return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-24 11:32:03
|
Revision: 2030 http://sourceforge.net/p/podofo/code/2030 Author: domseichter Date: 2021-01-24 11:31:56 +0000 (Sun, 24 Jan 2021) Log Message: ----------- PATCH: Patch by Chris: Also allow to set the bounding box with the legacy plan reader. Modified Paths: -------------- podofo/trunk/tools/podofoimpose/planreader_legacy.cpp Modified: podofo/trunk/tools/podofoimpose/planreader_legacy.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/planreader_legacy.cpp 2021-01-09 15:42:49 UTC (rev 2029) +++ podofo/trunk/tools/podofoimpose/planreader_legacy.cpp 2021-01-24 11:31:56 UTC (rev 2030) @@ -268,6 +268,8 @@ /// SUPPORTED if ( I->vars.find("$ScaleFactor") != I->vars.end() ) I->setScale( PoDoFo::Impose::PageRecord::calc( I->vars["$ScaleFactor"] , I->vars)); + if ( I->vars.find("$BoundingBox") != I->vars.end() ) + I->setBoundingBox(I->vars["$BoundingBox"]); /// END OF SUPPORTED This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-09 15:42:51
|
Revision: 2029 http://sourceforge.net/p/podofo/code/2029 Author: domseichter Date: 2021-01-09 15:42:49 +0000 (Sat, 09 Jan 2021) Log Message: ----------- Release tag Added Paths: ----------- podofobrowser/tags/RELEASE_0_9_7/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-09 15:23:56
|
Revision: 2028 http://sourceforge.net/p/podofo/code/2028 Author: domseichter Date: 2021-01-09 15:23:54 +0000 (Sat, 09 Jan 2021) Log Message: ----------- Release tag for 0.9.7 Added Paths: ----------- podofo/tags/RELEASE_0_9_7/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-09 15:23:13
|
Revision: 2027 http://sourceforge.net/p/podofo/code/2027 Author: domseichter Date: 2021-01-09 15:23:07 +0000 (Sat, 09 Jan 2021) Log Message: ----------- Release branch for 0.9.7 Added Paths: ----------- podofo/branches/PODOFO_0_9_7_BRANCH/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-09 15:20:48
|
Revision: 2026 http://sourceforge.net/p/podofo/code/2026 Author: domseichter Date: 2021-01-09 15:20:45 +0000 (Sat, 09 Jan 2021) Log Message: ----------- FIXED: Testcase should check for GetTime() == -1 for invalid dates Modified Paths: -------------- podofo/trunk/test/unit/DateTest.cpp Modified: podofo/trunk/test/unit/DateTest.cpp =================================================================== --- podofo/trunk/test/unit/DateTest.cpp 2021-01-06 23:25:15 UTC (rev 2025) +++ podofo/trunk/test/unit/DateTest.cpp 2021-01-09 15:20:45 UTC (rev 2026) @@ -126,15 +126,9 @@ memset (&_tm, 0, sizeof(struct tm)); const time_t t = date.GetTime(); - localtime_r(&t, &_tm); CPPUNIT_ASSERT_EQUAL(false, date.IsValid()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Year", 1970, _tm.tm_year + 1900); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Month", 1, _tm.tm_mon + 1); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Day", 1, _tm.tm_mday); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Hour", 0, _tm.tm_hour); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Minute", 59, _tm.tm_min); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Second", 59, _tm.tm_sec); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Invalid date should be equal to time_t(-1)", time_t(-1), t); } void DateTest::testParseDateValid() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-06 23:25:18
|
Revision: 2025 http://sourceforge.net/p/podofo/code/2025 Author: domseichter Date: 2021-01-06 23:25:15 +0000 (Wed, 06 Jan 2021) Log Message: ----------- Reapplied new patch from Federico Kircheis with additional test from reverted revision 2023 to fix PdfDate behaviour. Revision Links: -------------- http://sourceforge.net/p/podofo/code/2023 Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfDate.cpp podofo/trunk/src/podofo/base/PdfDate.h podofo/trunk/test/unit/DateTest.cpp podofo/trunk/test/unit/DateTest.h Modified: podofo/trunk/src/podofo/base/PdfDate.cpp =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.cpp 2021-01-06 22:59:25 UTC (rev 2024) +++ podofo/trunk/src/podofo/base/PdfDate.cpp 2021-01-06 23:25:15 UTC (rev 2025) @@ -36,7 +36,140 @@ #include <string.h> #include <sstream> +namespace { +/** Parse fixed length number from string + * \param in string to read number from + * \param length exact number characters to read + * \param min minimal value of number + * \param max maximal value of number + * \param ret parsed number (updated only on success) + */ +enum EParseFixLenNumberResult {Ok, Missing, Error}; +EParseFixLenNumberResult ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret_) +{ + if ( in == NULL || *in == '\0' || *in == '+' || *in == '-' || *in == 'Z') return Missing; + int ret = 0; + for(unsigned int i=0;i<length;i++) + { + if ( in == NULL || !isdigit(*in)) return Error; + ret = ret*10+ (*in-'0'); + in++; + } + if ( ret < min || ret > max ) return Error; + ret_ = ret; + return Ok; +} + +bool ParseOptionalFields(const char *&pszDate, tm& _tm) +{ + EParseFixLenNumberResult res = ParseFixLenNumber(pszDate,2,1,12,_tm.tm_mon); + if ( res == Error ) + { + return false; + } + else if( res == Missing) + { + return true; + } + _tm.tm_mon--; + + res = ParseFixLenNumber(pszDate,2,1,31,_tm.tm_mday); + if ( res == Error ) + { + return false; + } + else if( res == Missing) + { + return true; + } + + res = ParseFixLenNumber(pszDate,2,0,23,_tm.tm_hour); + if ( res == Error ) + { + return false; + } + else if( res == Missing) + { + return true; + } + + res = ParseFixLenNumber(pszDate,2,0,59,_tm.tm_min); + if ( res == Error ) + { + return false; + } + else if( res == Missing) + { + return true; + } + + res = ParseFixLenNumber(pszDate,2,0,59,_tm.tm_sec); + if ( res == Error ) + { + return false; + } + return true; +} + + +time_t ParseZoneShift(const char *&pszDate, tm& _tm) +{ + int nZoneShift = 0; + int nZoneHour = 0; + int nZoneMin = 0; + + if ( *pszDate != '\0' ) + { + switch (*pszDate) { + case '+': + nZoneShift = -1; + break; + case '-': + nZoneShift = 1; + break; + case 'Z': + nZoneShift = 0; + break; + default: + return time_t(-1); + } + pszDate++; + if ( ParseFixLenNumber(pszDate,2,0,59,nZoneHour) != Ok) + { + return time_t(-1); + } + if (*pszDate == '\'') { + pszDate++; + if ( ParseFixLenNumber(pszDate,2,0,59,nZoneMin) != Ok) + { + return time_t(-1); + } + if (*pszDate != '\'') + { + return time_t(-1); + } + pszDate++; + } + } + if ( *pszDate != '\0' ) + { + return time_t(-1); + } + + // convert to + time_t m_time = mktime(&_tm); + if ( m_time == -1 ) + { + return m_time; + } + + m_time += nZoneShift*(nZoneHour*3600 + nZoneMin*60); + return m_time; +} + +} + namespace PoDoFo { PdfDate::PdfDate() @@ -47,18 +180,15 @@ } PdfDate::PdfDate( const time_t & t ) - : m_bValid( false ) + : m_time( t ), m_bValid( false ) { - m_time = t; CreateStringRepresentation(); } PdfDate::PdfDate( const PdfString & sDate ) - : m_bValid( false ) + : m_time( -1 ), m_bValid( false ) { - m_time = -1; - - if ( !sDate.IsValid() ) + if ( !sDate.IsValid() ) { m_szDate[0] = 0; return; @@ -66,11 +196,8 @@ strncpy(m_szDate,sDate.GetString(),PDF_DATE_BUFFER_SIZE); - struct tm _tm; - memset( &_tm, 0, sizeof(_tm) ); - int nZoneShift = 0; - int nZoneHour = 0; - int nZoneMin = 0; + struct tm _tm{}; + _tm.tm_mday = 1; const char * pszDate = sDate.GetString(); if ( pszDate == NULL ) return; @@ -79,65 +206,20 @@ if ( *pszDate++ != ':' ) return; } - if ( ParseFixLenNumber(pszDate,4,0,9999,_tm.tm_year) == false ) + // year is not optional + if ( ParseFixLenNumber(pszDate,4,0,9999,_tm.tm_year) != Ok) return; - _tm.tm_year -= 1900; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,1,12,_tm.tm_mon) == false ) - return; - _tm.tm_mon--; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,1,31,_tm.tm_mday) == false ) return; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,0,23,_tm.tm_hour) == false ) return; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_min) == false ) return; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_sec) == false ) return; - if ( *pszDate != '\0' ) { - switch(*pszDate++) { - case '+': - nZoneShift = -1; - break; - case '-': - nZoneShift = 1; - break; - case 'Z': - nZoneShift = 0; - break; - default: - return; - } - if ( ParseFixLenNumber(pszDate,2,0,59,nZoneHour) == false ) return; - if ( *pszDate == '\'' ) { - pszDate++; - if ( ParseFixLenNumber(pszDate,2,0,59,nZoneMin) == false ) return; - if ( *pszDate != '\'' ) return; - pszDate++; - } - } - } - } - } - } - } - - if ( *pszDate != '\0' ) + // all other values are optional, if not set they are 0-init (except mday) + if(!ParseOptionalFields(pszDate, _tm)) { return; } - // convert to - m_time = mktime(&_tm); - if ( m_time == -1 ) - { - return; - } - - m_time += nZoneShift*(nZoneHour*3600 + nZoneMin*60); - m_bValid = true; + // zone is optional + m_time = ParseZoneShift(pszDate, _tm); + m_bValid = ( m_time != -1); } PdfDate::~PdfDate() @@ -205,20 +287,4 @@ m_bValid = true; } - -bool PdfDate::ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret) -{ - ret = 0; - for(unsigned int i=0;i<length;i++) - { - if ( in == NULL || !isdigit(*in)) return false; - ret = ret*10+ (*in-'0'); - in++; - } - if ( ret < min || ret > max ) return false; - return true; -} - }; - - Modified: podofo/trunk/src/podofo/base/PdfDate.h =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.h 2021-01-06 22:59:25 UTC (rev 2024) +++ podofo/trunk/src/podofo/base/PdfDate.h 2021-01-06 23:25:15 UTC (rev 2025) @@ -119,15 +119,6 @@ */ void CreateStringRepresentation(); - /** Parse fixed length number from string - * \param in string to read number from - * \param length of number to read - * \param min minimal value of number - * \param max maximal value of number - * \param ret parsed number - */ - bool ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret); - private: time_t m_time; char m_szDate[PDF_DATE_BUFFER_SIZE + 1]; // include also room for a nul-terminator in the buffer Modified: podofo/trunk/test/unit/DateTest.cpp =================================================================== --- podofo/trunk/test/unit/DateTest.cpp 2021-01-06 22:59:25 UTC (rev 2024) +++ podofo/trunk/test/unit/DateTest.cpp 2021-01-06 23:25:15 UTC (rev 2025) @@ -38,7 +38,14 @@ { PdfString tmp(pszDate); PdfDate date(tmp); - CPPUNIT_ASSERT_EQUAL(bExpected,date.IsValid()); + if( pszDate != NULL ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE(pszDate,bExpected,date.IsValid()); + } + else + { + CPPUNIT_ASSERT_EQUAL_MESSAGE("NULL",bExpected,date.IsValid()); + } } void DateTest::testCreateDateFromString() @@ -62,12 +69,16 @@ checkExpected("D:20120120135959Z00'0",false); checkExpected("D:20120120135959Z00'00",false); checkExpected("D:20120120135959Z00'00'",true); + + checkExpected("INVALID", false); } void DateTest::testDateValue() { - PdfDate date(PdfString("D:20120530235959Z00'00'")); - CPPUNIT_ASSERT_EQUAL(true,date.IsValid()); + const char* pszDate = "D:20120530235959Z00'00'"; + PdfString tmp(pszDate); + PdfDate date(tmp); + CPPUNIT_ASSERT_EQUAL_MESSAGE(std::string(pszDate),true,date.IsValid()); const time_t &time = date.GetTime(); struct tm _tm; memset (&_tm, 0, sizeof(struct tm)); @@ -81,4 +92,71 @@ CPPUNIT_ASSERT_EQUAL(true,time==time2); } +void DateTest::testAdditional() +{ + struct name_date { + std::string name; + std::string date; + }; + const name_date data[] = { + {"sample from pdf_reference_1_7.pdf", "D:199812231952-08'00'"}, + // UTC 1998-12-24 03:52:00 + {"all fields set", "D:20201223195200-08'00'"}, // UTC 2020-12-03:52:00 + {"set year", "D:2020"}, // UTC 2020-01-01 00:00:00 + {"set year, month", "D:202001"}, // UTC 2020-01-01 00:00:00 + {"set year, month, day", "D:20200101"}, // UTC 202001-01 00:00:00 + {"only year and timezone set", "D:2020-08'00'"}, // UTC 2020-01-01 08:00:00 + {"berlin", "D:20200315120820+01'00'"}, // UTC 2020-03-15 11:08:20 + }; + + for (const auto& d : data) { + std::cout << "Parse " << d.name << "\n"; + assert(PoDoFo::PdfDate(d.date).IsValid()); + } +} + + +void DateTest::testParseDateInvalid() +{ + PdfString tmp("D:2012020"); + PdfDate date(tmp); + + struct tm _tm; + memset (&_tm, 0, sizeof(struct tm)); + + const time_t t = date.GetTime(); + localtime_r(&t, &_tm); + + CPPUNIT_ASSERT_EQUAL(false, date.IsValid()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Year", 1970, _tm.tm_year + 1900); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Month", 1, _tm.tm_mon + 1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Day", 1, _tm.tm_mday); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Hour", 0, _tm.tm_hour); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Minute", 59, _tm.tm_min); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Second", 59, _tm.tm_sec); +} + +void DateTest::testParseDateValid() +{ + PdfString tmp("D:20120205132456"); + PdfDate date(tmp); + + struct tm _tm; + memset (&_tm, 0, sizeof(struct tm)); + + const time_t t = date.GetTime(); + localtime_r(&t, &_tm); + + CPPUNIT_ASSERT_EQUAL(true, date.IsValid()); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Year", 2012, _tm.tm_year + 1900); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Month", 2, _tm.tm_mon + 1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Day", 5, _tm.tm_mday); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Hour", 13, _tm.tm_hour); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Minute", 24, _tm.tm_min); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Second", 56, _tm.tm_sec); + +} + + + Modified: podofo/trunk/test/unit/DateTest.h =================================================================== --- podofo/trunk/test/unit/DateTest.h 2021-01-06 22:59:25 UTC (rev 2024) +++ podofo/trunk/test/unit/DateTest.h 2021-01-06 23:25:15 UTC (rev 2025) @@ -29,7 +29,11 @@ CPPUNIT_TEST_SUITE( DateTest ); CPPUNIT_TEST( testCreateDateFromString ); CPPUNIT_TEST( testDateValue ); + CPPUNIT_TEST( testAdditional ); + CPPUNIT_TEST( testParseDateValid ); + CPPUNIT_TEST( testParseDateInvalid ); CPPUNIT_TEST_SUITE_END(); + public: void setUp(); void tearDown(); @@ -36,6 +40,9 @@ void testCreateDateFromString(); void testDateValue(); + void testAdditional(); + void testParseDateInvalid(); + void testParseDateValid(); }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-06 22:59:31
|
Revision: 2024 http://sourceforge.net/p/podofo/code/2024 Author: domseichter Date: 2021-01-06 22:59:25 +0000 (Wed, 06 Jan 2021) Log Message: ----------- Revert previous commit Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfDate.cpp podofo/trunk/src/podofo/base/PdfDate.h podofo/trunk/test/unit/DateTest.cpp podofo/trunk/test/unit/DateTest.h Modified: podofo/trunk/src/podofo/base/PdfDate.cpp =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.cpp 2021-01-06 19:14:12 UTC (rev 2023) +++ podofo/trunk/src/podofo/base/PdfDate.cpp 2021-01-06 22:59:25 UTC (rev 2024) @@ -47,14 +47,17 @@ } PdfDate::PdfDate( const time_t & t ) - : m_time( t ), m_bValid( false ) + : m_bValid( false ) { + m_time = t; CreateStringRepresentation(); } PdfDate::PdfDate( const PdfString & sDate ) - : m_time( -1 ), m_bValid( false ) + : m_bValid( false ) { + m_time = -1; + if ( !sDate.IsValid() ) { m_szDate[0] = 0; @@ -63,8 +66,11 @@ strncpy(m_szDate,sDate.GetString(),PDF_DATE_BUFFER_SIZE); - struct tm _tm{}; - _tm.tm_mday = 1; + struct tm _tm; + memset( &_tm, 0, sizeof(_tm) ); + int nZoneShift = 0; + int nZoneHour = 0; + int nZoneMin = 0; const char * pszDate = sDate.GetString(); if ( pszDate == NULL ) return; @@ -73,57 +79,53 @@ if ( *pszDate++ != ':' ) return; } - // year is not optional - if ( !ParseFixLenNumber(pszDate,4,0,9999,_tm.tm_year) ) + if ( ParseFixLenNumber(pszDate,4,0,9999,_tm.tm_year) == false ) return; + _tm.tm_year -= 1900; + if ( *pszDate != '\0' ) { + if ( ParseFixLenNumber(pszDate,2,1,12,_tm.tm_mon) == false ) + return; - // all other values are optional, if not set they are 0-init (except mday) - if ( ParseFixLenNumber(pszDate,2,1,12,_tm.tm_mon) ) - { _tm.tm_mon--; - if ( ParseFixLenNumber(pszDate,2,1,31,_tm.tm_mday) ) - { - if ( ParseFixLenNumber(pszDate,2,0,23,_tm.tm_hour) ) - { - if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_min) ) - ParseFixLenNumber(pszDate,2,0,59,_tm.tm_sec); + if ( *pszDate != '\0' ) { + if ( ParseFixLenNumber(pszDate,2,1,31,_tm.tm_mday) == false ) return; + if ( *pszDate != '\0' ) { + if ( ParseFixLenNumber(pszDate,2,0,23,_tm.tm_hour) == false ) return; + if ( *pszDate != '\0' ) { + if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_min) == false ) return; + if ( *pszDate != '\0' ) { + if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_sec) == false ) return; + if ( *pszDate != '\0' ) { + switch(*pszDate++) { + case '+': + nZoneShift = -1; + break; + case '-': + nZoneShift = 1; + break; + case 'Z': + nZoneShift = 0; + break; + default: + return; + } + if ( ParseFixLenNumber(pszDate,2,0,59,nZoneHour) == false ) return; + if ( *pszDate == '\'' ) { + pszDate++; + if ( ParseFixLenNumber(pszDate,2,0,59,nZoneMin) == false ) return; + if ( *pszDate != '\'' ) return; + pszDate++; + } + } + } + } } } } - // zone is optional - int nZoneShift = 0; - int nZoneHour = 0; - int nZoneMin = 0; - if ( *pszDate != '\0' ) { - switch (*pszDate) { - case '+': - nZoneShift = -1; - break; - case '-': - nZoneShift = 1; - break; - case 'Z': - nZoneShift = 0; - break; - default: - return; - } - pszDate++; - if ( !ParseFixLenNumber(pszDate,2,0,59,nZoneHour) ) return; - if (*pszDate == '\'') { - pszDate++; - if ( !ParseFixLenNumber(pszDate,2,0,59,nZoneMin) ) return; - if (*pszDate != '\'') - return; - pszDate++; - } - } - if ( *pszDate != '\0' ) - { return; } @@ -134,7 +136,7 @@ return; } - m_time += nZoneShift*(nZoneHour*3600 + nZoneMin*60) ;//- timezone; + m_time += nZoneShift*(nZoneHour*3600 + nZoneMin*60); m_bValid = true; } @@ -204,9 +206,9 @@ } -bool PdfDate::ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret_) +bool PdfDate::ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret) { - int ret = 0; + ret = 0; for(unsigned int i=0;i<length;i++) { if ( in == NULL || !isdigit(*in)) return false; @@ -214,7 +216,6 @@ in++; } if ( ret < min || ret > max ) return false; - ret_ = ret; return true; } Modified: podofo/trunk/src/podofo/base/PdfDate.h =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.h 2021-01-06 19:14:12 UTC (rev 2023) +++ podofo/trunk/src/podofo/base/PdfDate.h 2021-01-06 22:59:25 UTC (rev 2024) @@ -121,10 +121,10 @@ /** Parse fixed length number from string * \param in string to read number from - * \param length exact number characters to read + * \param length of number to read * \param min minimal value of number * \param max maximal value of number - * \param ret parsed number (updated only on success) + * \param ret parsed number */ bool ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret); Modified: podofo/trunk/test/unit/DateTest.cpp =================================================================== --- podofo/trunk/test/unit/DateTest.cpp 2021-01-06 19:14:12 UTC (rev 2023) +++ podofo/trunk/test/unit/DateTest.cpp 2021-01-06 22:59:25 UTC (rev 2024) @@ -30,8 +30,8 @@ { } -void DateTest::tearDown(){ - +void DateTest::tearDown() +{ } void checkExpected(const char *pszDate, bool bExpected) @@ -38,14 +38,7 @@ { PdfString tmp(pszDate); PdfDate date(tmp); - if( pszDate != NULL ) - { - CPPUNIT_ASSERT_EQUAL_MESSAGE(pszDate,bExpected,date.IsValid()); - } - else - { - CPPUNIT_ASSERT_EQUAL_MESSAGE("NULL",bExpected,date.IsValid()); - } + CPPUNIT_ASSERT_EQUAL(bExpected,date.IsValid()); } void DateTest::testCreateDateFromString() @@ -52,15 +45,15 @@ { checkExpected(NULL,false); checkExpected("D:2012",true); - checkExpected("D:20120",true); // Previous versions of PoDoFo regarded this as invalid, now defaults are given + checkExpected("D:20120",false); checkExpected("D:201201",true); - checkExpected("D:2012010",true); // See above for handling in Previous versions + checkExpected("D:2012010",false); checkExpected("D:20120101",true); - checkExpected("D:201201012",true); // See above for handling in Previous versions + checkExpected("D:201201012",false); checkExpected("D:2012010123",true); - checkExpected("D:20120101235",true); // See above for handling in Previous versions + checkExpected("D:20120101235",false); checkExpected("D:201201012359",true); - checkExpected("D:2012010123595",true); // See above for handling in Previous versions + checkExpected("D:2012010123595",false); checkExpected("D:20120101235959",true); checkExpected("D:20120120135959Z",false); checkExpected("D:20120120135959Z0",false); @@ -69,17 +62,12 @@ checkExpected("D:20120120135959Z00'0",false); checkExpected("D:20120120135959Z00'00",false); checkExpected("D:20120120135959Z00'00'",true); - - checkExpected("INVALID", false); - } void DateTest::testDateValue() { - const char* pszDate = "D:20120530235959Z00'00'"; - PdfString tmp(pszDate); - PdfDate date(tmp); - CPPUNIT_ASSERT_EQUAL_MESSAGE(std::string(pszDate),true,date.IsValid()); + PdfDate date(PdfString("D:20120530235959Z00'00'")); + CPPUNIT_ASSERT_EQUAL(true,date.IsValid()); const time_t &time = date.GetTime(); struct tm _tm; memset (&_tm, 0, sizeof(struct tm)); @@ -93,48 +81,4 @@ CPPUNIT_ASSERT_EQUAL(true,time==time2); } -void DateTest::testAdditional() -{ - struct name_date { - std::string name; - std::string date; - }; - const name_date data[] = { - {"sample from pdf_reference_1_7.pdf", "D:199812231952-08'00'"}, - // UTC 1998-12-24 03:52:00 - {"all fields set", "D:20201223195200-08'00'"}, // UTC 2020-12-03:52:00 - {"set year", "D:2020"}, // UTC 2020-01-01 00:00:00 - {"set year, month", "D:202001"}, // UTC 2020-01-01 00:00:00 - {"set year, month, day", "D:20200101"}, // UTC 202001-01 00:00:00 - {"only year and timezone set", "D:2020-08'00'"}, // UTC 2020-01-01 08:00:00 - {"berlin", "D:20200315120820+01'00'"}, // UTC 2020-03-15 11:08:20 - }; - - for (const auto& d : data) { - std::cout << "Parse " << d.name << "\n"; - assert(PoDoFo::PdfDate(d.date).IsValid()); - } -} - -void DateTest::testParseDate() -{ - PdfString tmp("D:201202"); - PdfDate date(tmp); - - struct tm _tm; - memset (&_tm, 0, sizeof(struct tm)); - - const time_t t = date.GetTime(); - localtime_r(&t, &_tm); - - - CPPUNIT_ASSERT_EQUAL_MESSAGE("Year", 2012, _tm.tm_year + 1900); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Month", 2, _tm.tm_mon + 1); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Day", 1, _tm.tm_mday); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Hour", 0, _tm.tm_hour); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Minute", 0, _tm.tm_min); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Second", 0, _tm.tm_sec); - -} - Modified: podofo/trunk/test/unit/DateTest.h =================================================================== --- podofo/trunk/test/unit/DateTest.h 2021-01-06 19:14:12 UTC (rev 2023) +++ podofo/trunk/test/unit/DateTest.h 2021-01-06 22:59:25 UTC (rev 2024) @@ -29,8 +29,6 @@ CPPUNIT_TEST_SUITE( DateTest ); CPPUNIT_TEST( testCreateDateFromString ); CPPUNIT_TEST( testDateValue ); - CPPUNIT_TEST( testAdditional ); - CPPUNIT_TEST( testParseDate ); CPPUNIT_TEST_SUITE_END(); public: void setUp(); @@ -38,9 +36,6 @@ void testCreateDateFromString(); void testDateValue(); - void testAdditional(); - void testParseDate(); - }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-06 19:14:15
|
Revision: 2023 http://sourceforge.net/p/podofo/code/2023 Author: domseichter Date: 2021-01-06 19:14:12 +0000 (Wed, 06 Jan 2021) Log Message: ----------- PATCH: Patch by Federico Kircheis to improve date handling and parsing. Additional tests added by me. This patch changes behaviour of PdfDate::IsValid as many more dates are now considered valid. Instead of failing, we fill it up with default values so PoDoFo is more fault-tollerant here. Original issue was: It seems that the class PdfDate does not comply to the standard when parsing dates. pdf_reference_1_7.pdf (https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_reference_1-7.pdf) has as example "D:199812231952-08'00'" (3.8.3 Dates) as date, but PdfDate does not parse it correctly. Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfDate.cpp podofo/trunk/src/podofo/base/PdfDate.h podofo/trunk/test/unit/DateTest.cpp podofo/trunk/test/unit/DateTest.h Modified: podofo/trunk/src/podofo/base/PdfDate.cpp =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.cpp 2021-01-05 18:50:08 UTC (rev 2022) +++ podofo/trunk/src/podofo/base/PdfDate.cpp 2021-01-06 19:14:12 UTC (rev 2023) @@ -47,17 +47,14 @@ } PdfDate::PdfDate( const time_t & t ) - : m_bValid( false ) + : m_time( t ), m_bValid( false ) { - m_time = t; CreateStringRepresentation(); } PdfDate::PdfDate( const PdfString & sDate ) - : m_bValid( false ) + : m_time( -1 ), m_bValid( false ) { - m_time = -1; - if ( !sDate.IsValid() ) { m_szDate[0] = 0; @@ -66,11 +63,8 @@ strncpy(m_szDate,sDate.GetString(),PDF_DATE_BUFFER_SIZE); - struct tm _tm; - memset( &_tm, 0, sizeof(_tm) ); - int nZoneShift = 0; - int nZoneHour = 0; - int nZoneMin = 0; + struct tm _tm{}; + _tm.tm_mday = 1; const char * pszDate = sDate.GetString(); if ( pszDate == NULL ) return; @@ -79,53 +73,57 @@ if ( *pszDate++ != ':' ) return; } - if ( ParseFixLenNumber(pszDate,4,0,9999,_tm.tm_year) == false ) + // year is not optional + if ( !ParseFixLenNumber(pszDate,4,0,9999,_tm.tm_year) ) return; - _tm.tm_year -= 1900; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,1,12,_tm.tm_mon) == false ) - return; + // all other values are optional, if not set they are 0-init (except mday) + if ( ParseFixLenNumber(pszDate,2,1,12,_tm.tm_mon) ) + { _tm.tm_mon--; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,1,31,_tm.tm_mday) == false ) return; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,0,23,_tm.tm_hour) == false ) return; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_min) == false ) return; - if ( *pszDate != '\0' ) { - if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_sec) == false ) return; - if ( *pszDate != '\0' ) { - switch(*pszDate++) { - case '+': - nZoneShift = -1; - break; - case '-': - nZoneShift = 1; - break; - case 'Z': - nZoneShift = 0; - break; - default: - return; - } - if ( ParseFixLenNumber(pszDate,2,0,59,nZoneHour) == false ) return; - if ( *pszDate == '\'' ) { - pszDate++; - if ( ParseFixLenNumber(pszDate,2,0,59,nZoneMin) == false ) return; - if ( *pszDate != '\'' ) return; - pszDate++; - } - } - } - } + if ( ParseFixLenNumber(pszDate,2,1,31,_tm.tm_mday) ) + { + if ( ParseFixLenNumber(pszDate,2,0,23,_tm.tm_hour) ) + { + if ( ParseFixLenNumber(pszDate,2,0,59,_tm.tm_min) ) + ParseFixLenNumber(pszDate,2,0,59,_tm.tm_sec); } } } + // zone is optional + int nZoneShift = 0; + int nZoneHour = 0; + int nZoneMin = 0; + if ( *pszDate != '\0' ) { + switch (*pszDate) { + case '+': + nZoneShift = -1; + break; + case '-': + nZoneShift = 1; + break; + case 'Z': + nZoneShift = 0; + break; + default: + return; + } + pszDate++; + if ( !ParseFixLenNumber(pszDate,2,0,59,nZoneHour) ) return; + if (*pszDate == '\'') { + pszDate++; + if ( !ParseFixLenNumber(pszDate,2,0,59,nZoneMin) ) return; + if (*pszDate != '\'') + return; + pszDate++; + } + } + if ( *pszDate != '\0' ) + { return; } @@ -136,7 +134,7 @@ return; } - m_time += nZoneShift*(nZoneHour*3600 + nZoneMin*60); + m_time += nZoneShift*(nZoneHour*3600 + nZoneMin*60) ;//- timezone; m_bValid = true; } @@ -206,9 +204,9 @@ } -bool PdfDate::ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret) +bool PdfDate::ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret_) { - ret = 0; + int ret = 0; for(unsigned int i=0;i<length;i++) { if ( in == NULL || !isdigit(*in)) return false; @@ -216,6 +214,7 @@ in++; } if ( ret < min || ret > max ) return false; + ret_ = ret; return true; } Modified: podofo/trunk/src/podofo/base/PdfDate.h =================================================================== --- podofo/trunk/src/podofo/base/PdfDate.h 2021-01-05 18:50:08 UTC (rev 2022) +++ podofo/trunk/src/podofo/base/PdfDate.h 2021-01-06 19:14:12 UTC (rev 2023) @@ -121,10 +121,10 @@ /** Parse fixed length number from string * \param in string to read number from - * \param length of number to read + * \param length exact number characters to read * \param min minimal value of number * \param max maximal value of number - * \param ret parsed number + * \param ret parsed number (updated only on success) */ bool ParseFixLenNumber(const char *&in, unsigned int length, int min, int max, int &ret); Modified: podofo/trunk/test/unit/DateTest.cpp =================================================================== --- podofo/trunk/test/unit/DateTest.cpp 2021-01-05 18:50:08 UTC (rev 2022) +++ podofo/trunk/test/unit/DateTest.cpp 2021-01-06 19:14:12 UTC (rev 2023) @@ -30,8 +30,8 @@ { } -void DateTest::tearDown() -{ +void DateTest::tearDown(){ + } void checkExpected(const char *pszDate, bool bExpected) @@ -38,7 +38,14 @@ { PdfString tmp(pszDate); PdfDate date(tmp); - CPPUNIT_ASSERT_EQUAL(bExpected,date.IsValid()); + if( pszDate != NULL ) + { + CPPUNIT_ASSERT_EQUAL_MESSAGE(pszDate,bExpected,date.IsValid()); + } + else + { + CPPUNIT_ASSERT_EQUAL_MESSAGE("NULL",bExpected,date.IsValid()); + } } void DateTest::testCreateDateFromString() @@ -45,15 +52,15 @@ { checkExpected(NULL,false); checkExpected("D:2012",true); - checkExpected("D:20120",false); + checkExpected("D:20120",true); // Previous versions of PoDoFo regarded this as invalid, now defaults are given checkExpected("D:201201",true); - checkExpected("D:2012010",false); + checkExpected("D:2012010",true); // See above for handling in Previous versions checkExpected("D:20120101",true); - checkExpected("D:201201012",false); + checkExpected("D:201201012",true); // See above for handling in Previous versions checkExpected("D:2012010123",true); - checkExpected("D:20120101235",false); + checkExpected("D:20120101235",true); // See above for handling in Previous versions checkExpected("D:201201012359",true); - checkExpected("D:2012010123595",false); + checkExpected("D:2012010123595",true); // See above for handling in Previous versions checkExpected("D:20120101235959",true); checkExpected("D:20120120135959Z",false); checkExpected("D:20120120135959Z0",false); @@ -62,12 +69,17 @@ checkExpected("D:20120120135959Z00'0",false); checkExpected("D:20120120135959Z00'00",false); checkExpected("D:20120120135959Z00'00'",true); + + checkExpected("INVALID", false); + } void DateTest::testDateValue() { - PdfDate date(PdfString("D:20120530235959Z00'00'")); - CPPUNIT_ASSERT_EQUAL(true,date.IsValid()); + const char* pszDate = "D:20120530235959Z00'00'"; + PdfString tmp(pszDate); + PdfDate date(tmp); + CPPUNIT_ASSERT_EQUAL_MESSAGE(std::string(pszDate),true,date.IsValid()); const time_t &time = date.GetTime(); struct tm _tm; memset (&_tm, 0, sizeof(struct tm)); @@ -81,4 +93,48 @@ CPPUNIT_ASSERT_EQUAL(true,time==time2); } +void DateTest::testAdditional() +{ + struct name_date { + std::string name; + std::string date; + }; + const name_date data[] = { + {"sample from pdf_reference_1_7.pdf", "D:199812231952-08'00'"}, + // UTC 1998-12-24 03:52:00 + {"all fields set", "D:20201223195200-08'00'"}, // UTC 2020-12-03:52:00 + {"set year", "D:2020"}, // UTC 2020-01-01 00:00:00 + {"set year, month", "D:202001"}, // UTC 2020-01-01 00:00:00 + {"set year, month, day", "D:20200101"}, // UTC 202001-01 00:00:00 + {"only year and timezone set", "D:2020-08'00'"}, // UTC 2020-01-01 08:00:00 + {"berlin", "D:20200315120820+01'00'"}, // UTC 2020-03-15 11:08:20 + }; + + for (const auto& d : data) { + std::cout << "Parse " << d.name << "\n"; + assert(PoDoFo::PdfDate(d.date).IsValid()); + } +} + +void DateTest::testParseDate() +{ + PdfString tmp("D:201202"); + PdfDate date(tmp); + + struct tm _tm; + memset (&_tm, 0, sizeof(struct tm)); + + const time_t t = date.GetTime(); + localtime_r(&t, &_tm); + + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Year", 2012, _tm.tm_year + 1900); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Month", 2, _tm.tm_mon + 1); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Day", 1, _tm.tm_mday); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Hour", 0, _tm.tm_hour); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Minute", 0, _tm.tm_min); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Second", 0, _tm.tm_sec); + +} + Modified: podofo/trunk/test/unit/DateTest.h =================================================================== --- podofo/trunk/test/unit/DateTest.h 2021-01-05 18:50:08 UTC (rev 2022) +++ podofo/trunk/test/unit/DateTest.h 2021-01-06 19:14:12 UTC (rev 2023) @@ -29,6 +29,8 @@ CPPUNIT_TEST_SUITE( DateTest ); CPPUNIT_TEST( testCreateDateFromString ); CPPUNIT_TEST( testDateValue ); + CPPUNIT_TEST( testAdditional ); + CPPUNIT_TEST( testParseDate ); CPPUNIT_TEST_SUITE_END(); public: void setUp(); @@ -36,6 +38,9 @@ void testCreateDateFromString(); void testDateValue(); + void testAdditional(); + void testParseDate(); + }; #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-05 18:50:10
|
Revision: 2022 http://sourceforge.net/p/podofo/code/2022 Author: domseichter Date: 2021-01-05 18:50:08 +0000 (Tue, 05 Jan 2021) Log Message: ----------- PATCH: #102 by Ivan Romanov: > Hi guys. Recently I need to remove watermarks in some pdfs and can't find tool for this. Unsure no good tools to modify pdfs in Linux. But I found PoDoFo library and wrote a tool which allows to do it. See patch in attachments. > This patch removes options content from pdf. It can handle whoe OCGs or select by name. > Usage > podofonooc <in.pdf> <out.pdf> [OC_name]...</out.pdf></in.pdf> Modified Paths: -------------- podofo/trunk/tools/CMakeLists.txt Added Paths: ----------- podofo/trunk/tools/podofonooc/ podofo/trunk/tools/podofonooc/CMakeLists.txt podofo/trunk/tools/podofonooc/podofonooc.cpp Modified: podofo/trunk/tools/CMakeLists.txt =================================================================== --- podofo/trunk/tools/CMakeLists.txt 2021-01-05 18:38:57 UTC (rev 2021) +++ podofo/trunk/tools/CMakeLists.txt 2021-01-05 18:50:08 UTC (rev 2022) @@ -16,6 +16,7 @@ podofoimpose podofoincrementalupdates podofoxmp + podofonooc ) IF(PODOFO_HAVE_OPENSSL) Added: podofo/trunk/tools/podofonooc/CMakeLists.txt =================================================================== --- podofo/trunk/tools/podofonooc/CMakeLists.txt (rev 0) +++ podofo/trunk/tools/podofonooc/CMakeLists.txt 2021-01-05 18:50:08 UTC (rev 2022) @@ -0,0 +1,7 @@ +ADD_EXECUTABLE(podofonooc podofonooc.cpp) + +TARGET_LINK_LIBRARIES(podofonooc ${PODOFO_LIB}) +SET_TARGET_PROPERTIES(podofonooc PROPERTIES COMPILE_FLAGS "${PODOFO_CFLAGS}") +ADD_DEPENDENCIES(podofonooc ${PODOFO_DEPEND_TARGET}) +INSTALL(TARGETS podofonooc + RUNTIME DESTINATION "bin") Added: podofo/trunk/tools/podofonooc/podofonooc.cpp =================================================================== --- podofo/trunk/tools/podofonooc/podofonooc.cpp (rev 0) +++ podofo/trunk/tools/podofonooc/podofonooc.cpp 2021-01-05 18:50:08 UTC (rev 2022) @@ -0,0 +1,141 @@ +/*************************************************************************** + * Copyright (C) 2020 Ivan Romanov <dr...@zo... * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA * + ***************************************************************************/ + +#include <iostream> +#include <iterator> +#include <string> +#include <cstdlib> +#include <cstdio> +#include <algorithm> + +#ifdef _MSC_VER + #include <io.h> + #include <fcntl.h> +#endif + +#include <podofo.h> + +using namespace std; + +int main (int argc, char * argv[]) +{ + using namespace PoDoFo; + PoDoFo::PdfMemDocument * doc = NULL; + int result = 0; + + try { + PoDoFo::PdfError::EnableDebug(false); + if (argc < 3) + { + cout << "Usage" << endl; + cout << " " << argv[0] << " <in.pdf> <out.pdf> [OC_name]..." << endl; + return EXIT_FAILURE; + } + + if ( string("-") == argv[1] ) + { + cin >> std::noskipws; +#ifdef _MSC_VER + _setmode(_fileno(stdin), _O_BINARY); // @TODO: MSVC specific binary setmode -- not sure if other platforms need it + cin.sync_with_stdio(); +#endif + istream_iterator<char> it(std::cin); + istream_iterator<char> end; + string buffer(it, end); + doc = new PoDoFo::PdfMemDocument(); + doc->LoadFromBuffer( buffer.c_str(), static_cast<long>(buffer.size()) ); + } + else + { + doc = new PoDoFo::PdfMemDocument(argv[1]); + } + + vector<string> ocToRemove; + + for (int i = 3; i < argc; i++) + { + ocToRemove.push_back(string(argv[i])); + } + + int ocCount = 0; + PdfObject * ocProperties = doc->GetTrailer()->MustGetIndirectKey("Root")->GetIndirectKey("OCProperties"); + + if (ocProperties) { + PdfObject * ocgs = ocProperties->GetIndirectKey("OCGs"); + + if (ocgs) + { + PdfVecObjects & docObjects = doc->GetObjects(); + PdfArray ocgsArr = ocgs->GetArray(); + for (PdfArray::iterator it = ocgsArr.begin(); it != ocgsArr.end(); it++) + { + PdfReference ocgRef = (*it).GetReference(); + if (!docObjects.GetObject(ocgRef)) + continue; + + const string &ocgName = docObjects.GetObject(ocgRef)->MustGetIndirectKey("Name")->GetString().GetStringUtf8(); + + if (!ocToRemove.empty() && find(ocToRemove.begin(), ocToRemove.end(), ocgName) == ocToRemove.end()) + { + continue; + } + + for (int i = docObjects.GetSize() - 1; i >= 0; i--) + { + PdfObject * ob = docObjects[i]; + + if (ob->IsDictionary()) + { + PdfObject * oc = ob->GetDictionary().GetKey("OC"); + if (oc) { + PdfReference ocRef = oc->GetReference(); + if (ocRef == ocgRef || (docObjects.GetObject(ocRef)->GetIndirectKey("OCGs") && docObjects.GetObject(ocRef)->GetDictionary().GetKey("OCGs")->GetReference() == ocgRef)) + { + docObjects.RemoveObject(ob->Reference()); + ocCount++; + } + } + } + } + + docObjects.RemoveObject(ocgRef); + } + } + } + + if (ocCount) + { + doc->Write(argv[2]); + } + else + { + cout << "No optional content in this PDF" << endl; + } + } catch( PdfError & e ) { + std::cerr << "Error: An error " << e.GetError() << " occurred during the process of the pdf file:" << std::endl; + e.PrintErrorMsg(); + + result = e.GetError(); + } + + if( doc ) + delete doc; + + return result; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-05 18:38:59
|
Revision: 2021 http://sourceforge.net/p/podofo/code/2021 Author: domseichter Date: 2021-01-05 18:38:57 +0000 (Tue, 05 Jan 2021) Log Message: ----------- PATCH: \#109 Fixed spelling error interpretor->interpreter Modified Paths: -------------- podofo/trunk/man/podofoimpose.1 podofo/trunk/tools/podofoimpose/podofoimpose.cpp Modified: podofo/trunk/man/podofoimpose.1 =================================================================== --- podofo/trunk/man/podofoimpose.1 2021-01-05 16:56:54 UTC (rev 2020) +++ podofo/trunk/man/podofoimpose.1 2021-01-05 18:38:57 UTC (rev 2021) @@ -4,7 +4,7 @@ podofoimpose \- A powerful PDF imposition tool .PP .SH SYNOPSIS -\fBpodofoimpose\fR Input Output Plan [Interpretor] +\fBpodofoimpose\fR Input Output Plan [Interpreter] .PP .SH DESCRIPTION .B podofoimpose @@ -29,9 +29,9 @@ Imposition plan file\. .RE .PP -\fB[Interpretor]\fR +\fB[Interpreter]\fR .RS -Imposition interpretor\. It can be "native" (default value) or "lua"\. +Imposition interpreter\. It can be "native" (default value) or "lua"\. .RE .PP .SH SEE ALSO Modified: podofo/trunk/tools/podofoimpose/podofoimpose.cpp =================================================================== --- podofo/trunk/tools/podofoimpose/podofoimpose.cpp 2021-01-05 16:56:54 UTC (rev 2020) +++ podofo/trunk/tools/podofoimpose/podofoimpose.cpp 2021-01-05 18:38:57 UTC (rev 2021) @@ -41,12 +41,12 @@ void usage() { - cerr << "Usage : " << params.executablePath << " Input Output Plan [Interpretor]" << endl; + cerr << "Usage : " << params.executablePath << " Input Output Plan [Interpreter]" << endl; cerr << "***" << endl; cerr << "\tInput is a PDF file or a file which contains a list of PDF file paths" << endl<< endl; cerr << "\tOutput will be a PDF file" << endl<< endl; cerr << "\tPlan is an imposition plan file" <<endl<< endl; - cerr << "\t[Interpretor] Can be \"native\" (default value) or \"lua\""<< endl<< endl; + cerr << "\t[Interpreter] Can be \"native\" (default value) or \"lua\""<< endl<< endl; cerr << "PoDoFo Version: " << PODOFO_VERSION_STRING << endl << endl; } @@ -68,11 +68,11 @@ { std::string native ( "native" ); std::string lua ( "lua" ); - std::string interpretor ( argv[4] ); + std::string interpreter ( argv[4] ); - if ( !interpretor.compare ( native ) ) + if ( !interpreter.compare ( native ) ) params.planReader = PoDoFo::Impose::Legacy; - else if ( !interpretor.compare ( lua ) ) + else if ( !interpreter.compare ( lua ) ) params.planReader = PoDoFo::Impose::Lua; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-05 16:56:57
|
Revision: 2020 http://sourceforge.net/p/podofo/code/2020 Author: domseichter Date: 2021-01-05 16:56:54 +0000 (Tue, 05 Jan 2021) Log Message: ----------- Version bump to 0.9.7 as part of release preparation Modified Paths: -------------- podofo/trunk/CMakeLists.txt Modified: podofo/trunk/CMakeLists.txt =================================================================== --- podofo/trunk/CMakeLists.txt 2021-01-05 12:50:43 UTC (rev 2019) +++ podofo/trunk/CMakeLists.txt 2021-01-05 16:56:54 UTC (rev 2020) @@ -12,7 +12,7 @@ SET(PODOFO_VERSION_MAJOR "0" CACHE STRING "Major part of PoDoFo version number") SET(PODOFO_VERSION_MINOR "9" CACHE STRING "Minor part of PoDoFo version number") -SET(PODOFO_VERSION_PATCH "6" CACHE STRING "Patchlevel part of PoDoFo version number") +SET(PODOFO_VERSION_PATCH "7" CACHE STRING "Patchlevel part of PoDoFo version number") SET(PODOFO_SOVERSION "${PODOFO_VERSION_MAJOR}.${PODOFO_VERSION_MINOR}.${PODOFO_VERSION_PATCH}") SET(PODOFO_LIBVERSION "${PODOFO_SOVERSION}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2021-01-05 12:50:44
|
Revision: 2019 http://sourceforge.net/p/podofo/code/2019 Author: domseichter Date: 2021-01-05 12:50:43 +0000 (Tue, 05 Jan 2021) Log Message: ----------- PATCH: Patch by Tomas Bernkov to support PDFs with multiple spaces between stream keyword and data Modified Paths: -------------- podofo/trunk/src/podofo/base/PdfParserObject.cpp Modified: podofo/trunk/src/podofo/base/PdfParserObject.cpp =================================================================== --- podofo/trunk/src/podofo/base/PdfParserObject.cpp 2020-12-27 18:08:23 UTC (rev 2018) +++ podofo/trunk/src/podofo/base/PdfParserObject.cpp 2021-01-05 12:50:43 UTC (rev 2019) @@ -258,12 +258,20 @@ m_device.Device()->Seek( m_lStreamOffset ); + do + { + // Skip spaces between the stream keyword and the carriage return/line feed or line feed + // Actually, this is not required by PDF Reference, but certain PDFs have additionals whitespaces + c = m_device.Device()->Look(); + if ( c == ' ' ) + c = m_device.Device()->GetChar(); + } while ( c == ' ' ); + // From the PDF Reference manual // The keyword stream that follows // the stream dictionary should be followed by an end-of-line marker consisting of // either a carriage return and a line feed or just a line feed, and not by a carriage re- // turn alone. - c = m_device.Device()->Look(); if( PdfTokenizer::IsWhitespace( c ) ) { c = m_device.Device()->GetChar(); @@ -277,7 +285,7 @@ } } } - + pdf_long fLoc = m_device.Device()->Tell(); // we need to save this, since loading the Length key could disturb it! PdfObject* pObj = this->GetDictionary_NoDL().GetKey( PdfName::KeyLength ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2020-12-27 18:08:30
|
Revision: 2018 http://sourceforge.net/p/podofo/code/2018 Author: domseichter Date: 2020-12-27 18:08:23 +0000 (Sun, 27 Dec 2020) Log Message: ----------- FIXED: Build and likage with latest podofo Modified Paths: -------------- podofobrowser/trunk/src/podofobrowser.cpp Modified: podofobrowser/trunk/src/podofobrowser.cpp =================================================================== --- podofobrowser/trunk/src/podofobrowser.cpp 2020-12-27 17:54:54 UTC (rev 2017) +++ podofobrowser/trunk/src/podofobrowser.cpp 2020-12-27 18:08:23 UTC (rev 2018) @@ -1005,7 +1005,8 @@ void PoDoFoBrowser::toolsToHex() { - std::unique_ptr<PdfFilter> hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); + PoDoFo::PdfFilter* hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); + // std::unique_ptr<PdfFilter> hexfilter = ; char* pBuffer = NULL; pdf_long lLen = 0; @@ -1031,7 +1032,7 @@ void PoDoFoBrowser::toolsFromHex() { - std::unique_ptr<PdfFilter> hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); + PdfFilter* hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); char* pBuffer = NULL; pdf_long lLen = 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dom...@us...> - 2020-12-27 17:55:02
|
Revision: 2017 http://sourceforge.net/p/podofo/code/2017 Author: domseichter Date: 2020-12-27 17:54:54 +0000 (Sun, 27 Dec 2020) Log Message: ----------- Ticket 118: Patch for build with Qt5 Modified Paths: -------------- podofobrowser/trunk/CMakeLists.txt podofobrowser/trunk/INSTALL podofobrowser/trunk/README podofobrowser/trunk/cmake/modules/FindLIBFREETYPE.cmake podofobrowser/trunk/src/CMakeLists.txt podofobrowser/trunk/src/backgroundloader.cpp podofobrowser/trunk/src/backgroundloader.h podofobrowser/trunk/src/hexwidget/QHexView.cpp podofobrowser/trunk/src/main.cpp podofobrowser/trunk/src/podofoaboutdlg.ui podofobrowser/trunk/src/podofobrowser.cpp podofobrowser/trunk/src/podofobrowser.h podofobrowser/trunk/src/podofobrowserbase.ui podofobrowser/trunk/src/podofofinddlg.ui podofobrowser/trunk/src/podofogotodlg.ui podofobrowser/trunk/src/podofogotopagedlg.ui podofobrowser/trunk/src/podofoinfodlg.cpp podofobrowser/trunk/src/podofoinfodlg.ui podofobrowser/trunk/src/podoforeplacedlg.ui podofobrowser/trunk/src/podofoutil.cpp Modified: podofobrowser/trunk/CMakeLists.txt =================================================================== --- podofobrowser/trunk/CMakeLists.txt 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/CMakeLists.txt 2020-12-27 17:54:54 UTC (rev 2017) @@ -9,12 +9,10 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") MESSAGE("Remember to set QTDIR in your environment if qmake is not found") -SET(QT_MIN_VERSION "4.2.0") -SET(QT_USE_QT3SUPPORT FALSE) +SET(QT_MIN_VERSION "5.0.0") SET(QT_USE_QTUITOOLS TRUE) SET(QT_REQUIRED TRUE) -FIND_PACKAGE(Qt4 REQUIRED) -INCLUDE(${QT_USE_FILE}) +FIND_PACKAGE(Qt5 COMPONENTS Core Widgets REQUIRED) # These were commented out with no explanation as to why. # PoDoFoBrowser cannot link to a static libpodofo without Modified: podofobrowser/trunk/INSTALL =================================================================== --- podofobrowser/trunk/INSTALL 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/INSTALL 2020-12-27 17:54:54 UTC (rev 2017) @@ -28,7 +28,7 @@ -DCMAKE_LIBRARY_PATH=/path/to/extra/libraries Windows users can also build PoDoFoBrowser using CMake. You will need an -installed copy of PoDoFo and will need to have Qt 4.3.2 or 4.4 installed. Set +installed copy of PoDoFo and will need to have Qt 5.0 or greater installed. Set QTDIR to point to your Qt install directory, ensure MinGW is on your PATH, and make sure to set CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH to point to the same libraries you used to build PoDoFo against (important!). LIBPODOFO_DIR should Modified: podofobrowser/trunk/README =================================================================== --- podofobrowser/trunk/README 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/README 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,8 +1,8 @@ -PoDoFoBrowser is a Qt 4 application for browsing the objects in a PDF file and +PoDoFoBrowser is a Qt 5 application for browsing the objects in a PDF file and modifying their keys easily. It is very useful if you want to look on the internal structure of PDF files. -You will need Qt version 4.2.0 or newer, a c++ compiler, and PoDoFo to build +You will need Qt version 5.0 or newer, a c++ compiler, and PoDoFo to build PoDoFoBrowser. CMake is used as the build system (see the INSTALL file for details), though you can use qmake if you prefer. Modified: podofobrowser/trunk/cmake/modules/FindLIBFREETYPE.cmake =================================================================== --- podofobrowser/trunk/cmake/modules/FindLIBFREETYPE.cmake 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/cmake/modules/FindLIBFREETYPE.cmake 2020-12-27 17:54:54 UTC (rev 2017) @@ -2,7 +2,7 @@ # non-portable shell script to find them. Find ft2build.h and try to determine # where freetype.h is relative to it. # TODO: use pkg-config and/or freetype-config to find freetype when possible -FIND_PATH(LIBFREETYPE_FT2BUILD_H NAMES ft2build.h) +find_path(LIBFREETYPE_FT2BUILD_H NAMES ft2build.h PATHS /usr/include/freetype2/ ) # We don't look for freetype.h since a file of the same name appears in # FreeType 1 and confuses the detection code. Instead, locate # config/ftheader.h since this does NOT appear in freetype 1. Modified: podofobrowser/trunk/src/CMakeLists.txt =================================================================== --- podofobrowser/trunk/src/CMakeLists.txt 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/CMakeLists.txt 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,4 +1,4 @@ -QT4_WRAP_UI(podofobrowser_UIC_HEADERS +QT5_WRAP_UI(podofobrowser_UIC_HEADERS podofoaboutdlg.ui podofobrowserbase.ui podofofinddlg.ui @@ -14,13 +14,13 @@ pdfobjectmodel.h hexwidget/QHexView.h ) -QT4_WRAP_CPP(podofobrowser_MOC_SRCS ${podofobrowser_MOC_HEADERS}) +QT5_WRAP_CPP(podofobrowser_MOC_SRCS ${podofobrowser_MOC_HEADERS}) # Qt resources such as icons to be embedded in the executable SET(podofobrowser_RSRC_FILES podofobrowserrsrc.qrc ) -QT4_ADD_RESOURCES(podofobrowser_QRC_SRCS ${podofobrowser_RSRC_FILES}) +QT5_ADD_RESOURCES(podofobrowser_QRC_SRCS ${podofobrowser_RSRC_FILES}) # WTF does this not get done for us? SET_SOURCE_FILES_PROPERTIES( @@ -41,6 +41,8 @@ ${podofobrowser_MOC_SRCS} ) +target_link_libraries(podofobrowser Qt5::Widgets) + IF(NOT WIN32) SET(extra_libs ${LIBFONTCONFIG_LIB}) ELSE(NOT WIN32) @@ -61,6 +63,8 @@ ${LIBJPEG_LIB} ${LIBZ_LIB} ${stlport_libraries_if_use_stlport} + pthread + fontconfig ) ADD_DEFINITIONS( Modified: podofobrowser/trunk/src/backgroundloader.cpp =================================================================== --- podofobrowser/trunk/src/backgroundloader.cpp 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/backgroundloader.cpp 2020-12-27 17:54:54 UTC (rev 2017) @@ -5,13 +5,13 @@ #include <iostream> -BackgroundLoader::BackgroundLoader(PdfMemDocument* doc) +BackgroundLoader::BackgroundLoader(PdfDocument* doc) : m_timer(), m_lastObjectIdx(-1), m_pDoc(doc) { connect(&m_timer, SIGNAL(timeout()), SLOT(loadNextObject())); - qDebug("Beginning background load of %i objects", doc->GetObjects().GetSize()); + qDebug("Beginning background load of %i objects", doc->GetObjects()->GetSize()); } BackgroundLoader::~BackgroundLoader() @@ -27,7 +27,7 @@ { // FIXME: We should not have to cast away constness in pdfvecobjects // just to index its members. - PdfVecObjects & objs = const_cast<PdfVecObjects&>(m_pDoc->GetObjects()); + PdfVecObjects & objs = *m_pDoc->GetObjects(); const int objCount = objs.GetSize(); if (m_lastObjectIdx + 1 >= objCount) Modified: podofobrowser/trunk/src/backgroundloader.h =================================================================== --- podofobrowser/trunk/src/backgroundloader.h 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/backgroundloader.h 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,11 +1,10 @@ #ifndef PODOFOBROWSER_BACKGROUNDLOADER_H #define PODOFOBROWSER_BACKGROUNDLOADER_H -#include <QObject> #include <QTimer> namespace PoDoFo { - class PdfMemDocument; + class PdfDocument; class PdfObject; } @@ -14,7 +13,7 @@ Q_OBJECT public: - BackgroundLoader(PoDoFo::PdfMemDocument* doc); + BackgroundLoader(PoDoFo::PdfDocument* doc); virtual ~BackgroundLoader(); @@ -35,7 +34,7 @@ // an invalid iterator could be _BAD_. int m_lastObjectIdx; // Document - PoDoFo::PdfMemDocument* m_pDoc; + PoDoFo::PdfDocument* m_pDoc; }; #endif Modified: podofobrowser/trunk/src/hexwidget/QHexView.cpp =================================================================== --- podofobrowser/trunk/src/hexwidget/QHexView.cpp 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/hexwidget/QHexView.cpp 2020-12-27 17:54:54 UTC (rev 2017) @@ -84,9 +84,9 @@ QString QHexView::formatAddress(address_t address) { QString ret; #if QT_POINTER_SIZE == 4 - ret.sprintf(m_AddressFormatString, (address >> 16) & 0xffff, address & 0xffff); + ret.asprintf(m_AddressFormatString, (address >> 16) & 0xffff, address & 0xffff); #elif QT_POINTER_SIZE == 8 - ret.sprintf(m_AddressFormatString, (address >> 32) & 0xffffffff, address & 0xffffffff); + ret.asprintf(m_AddressFormatString, (address >> 32) & 0xffffffff, address & 0xffffffff); #endif return ret; } @@ -839,12 +839,12 @@ switch(m_WordWidth) { case 1: value.b |= dataRef[bufIdx + 0]; - byteBuffer.sprintf("%02x", value.b); + byteBuffer.asprintf("%02x", value.b); break; case 2: value.w |= dataRef[bufIdx + 0]; value.w |= dataRef[bufIdx + 1] << 8; - byteBuffer.sprintf("%04x", value.w); + byteBuffer.asprintf("%04x", value.w); break; case 4: value.d |= dataRef[bufIdx + 0]; @@ -851,7 +851,7 @@ value.d |= dataRef[bufIdx + 1] << 8; value.d |= dataRef[bufIdx + 2] << 16; value.d |= dataRef[bufIdx + 3] << 24; - byteBuffer.sprintf("%08x", value.d); + byteBuffer.asprintf("%08x", value.d); break; case 8: // we need the cast to ensure that it won't assume 32-bit @@ -864,7 +864,7 @@ value.q |= static_cast<quint64>(dataRef[bufIdx + 5]) << 40; value.q |= static_cast<quint64>(dataRef[bufIdx + 6]) << 48; value.q |= static_cast<quint64>(dataRef[bufIdx + 7]) << 56; - byteBuffer.sprintf("%016llx", value.q); + byteBuffer.asprintf("%016llx", value.q); break; } Modified: podofobrowser/trunk/src/main.cpp =================================================================== --- podofobrowser/trunk/src/main.cpp 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/main.cpp 2020-12-27 17:54:54 UTC (rev 2017) @@ -21,7 +21,6 @@ #include <QApplication> #include "podofobrowser.h" -#include <qapplication.h> int main( int argc, char ** argv ) { QApplication a( argc, argv ); @@ -29,10 +28,12 @@ a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) ); - if( qApp->argc() >= 2 ) + QStringList args = a.arguments(); + + if( args.count() >= 2 ) { - for( int i=1; i<qApp->argc(); i++ ) - new PoDoFoBrowser( QString::fromLocal8Bit( qApp->argv()[i] ) ); + for( int i=1; i<args.count(); i++ ) + new PoDoFoBrowser( args[i] ); } else { Modified: podofobrowser/trunk/src/podofoaboutdlg.ui =================================================================== --- podofobrowser/trunk/src/podofoaboutdlg.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofoaboutdlg.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,4 +1,4 @@ -<ui version="4.0" > +<ui version="5.0" > <class>PodofoAboutDlg</class> <widget class="QDialog" name="PodofoAboutDlg" > <property name="geometry" > @@ -117,7 +117,6 @@ </layout> </widget> <layoutdefault spacing="6" margin="11" /> - <pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <resources/> <connections> <connection> Modified: podofobrowser/trunk/src/podofobrowser.cpp =================================================================== --- podofobrowser/trunk/src/podofobrowser.cpp 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofobrowser.cpp 2020-12-27 17:54:54 UTC (rev 2017) @@ -102,23 +102,23 @@ connect( buttonImport, SIGNAL( clicked() ), this, SLOT( slotImportStream() ) ); connect( buttonExport, SIGNAL( clicked() ), this, SLOT( slotExportStream() ) ); - connect( fileReloadAction, SIGNAL( activated() ), this, SLOT( fileReload() ) ); - connect( actionInformations, SIGNAL( activated() ), this, SLOT( fileInfo() ) ); - connect( actionInsert_Before, SIGNAL( activated() ), this, SLOT( editInsertBefore() ) ); - connect( actionInsert_After, SIGNAL( activated() ), this, SLOT( editInsertAfter() ) ); - connect( actionInsert_Key, SIGNAL( activated() ), this, SLOT( editInsertKey() ) ); - connect( actionInsert_Child, SIGNAL( activated() ), this, SLOT( editInsertChildBelow() ) ); - connect( actionRemove_Item, SIGNAL( activated() ), this, SLOT( editRemoveItem()) ); - connect( actionRefreshView, SIGNAL( activated() ), this, SLOT( viewRefreshView()) ); - connect( actionCatalogView, SIGNAL( activated() ), this, SLOT( viewRefreshView()) ); - connect( actionCreateNewObject, SIGNAL( activated() ), this, SLOT( editCreateNewObject()) ); - connect( actionToolsDisplayCodeForSelection, SIGNAL( activated() ), this, SLOT( toolsDisplayCodeForSelection()) ); - connect( actionFind, SIGNAL( activated() ), this, SLOT( editFind() ) ); - connect( actionFindNext, SIGNAL( activated() ), this, SLOT( editFindNext() ) ); - connect( actionFindPrevious, SIGNAL( activated() ), this, SLOT( editFindPrevious() ) ); - connect( actionReplace, SIGNAL( activated() ), this, SLOT( editReplace() ) ); - connect( actionGotoObject, SIGNAL( activated() ), this, SLOT( editGotoObject() ) ); - connect( actionGotoPage, SIGNAL( activated() ), this, SLOT( editGotoPage() ) ); + connect( fileReloadAction, SIGNAL( triggered() ), this, SLOT( fileReload() ) ); + connect( actionInformations, SIGNAL( triggered() ), this, SLOT( fileInfo() ) ); + connect( actionInsert_Before, SIGNAL( triggered() ), this, SLOT( editInsertBefore() ) ); + connect( actionInsert_After, SIGNAL( triggered() ), this, SLOT( editInsertAfter() ) ); + connect( actionInsert_Key, SIGNAL( triggered() ), this, SLOT( editInsertKey() ) ); + connect( actionInsert_Child, SIGNAL( triggered() ), this, SLOT( editInsertChildBelow() ) ); + connect( actionRemove_Item, SIGNAL( triggered() ), this, SLOT( editRemoveItem()) ); + connect( actionRefreshView, SIGNAL( triggered() ), this, SLOT( viewRefreshView()) ); + connect( actionCatalogView, SIGNAL( triggered() ), this, SLOT( viewRefreshView()) ); + connect( actionCreateNewObject, SIGNAL( triggered() ), this, SLOT( editCreateNewObject()) ); + connect( actionToolsDisplayCodeForSelection, SIGNAL( triggered() ), this, SLOT( toolsDisplayCodeForSelection()) ); + connect( actionFind, SIGNAL( triggered() ), this, SLOT( editFind() ) ); + connect( actionFindNext, SIGNAL( triggered() ), this, SLOT( editFindNext() ) ); + connect( actionFindPrevious, SIGNAL( triggered() ), this, SLOT( editFindPrevious() ) ); + connect( actionReplace, SIGNAL( triggered() ), this, SLOT( editReplace() ) ); + connect( actionGotoObject, SIGNAL( triggered() ), this, SLOT( editGotoObject() ) ); + connect( actionGotoPage, SIGNAL( triggered() ), this, SLOT( editGotoPage() ) ); connect( checkEditable, SIGNAL(toggled(bool)), this, SLOT(slotSetStreamEditable(bool)) ); connect( commitButton, SIGNAL(clicked()), this, SLOT(slotCommitStream()) ); @@ -225,7 +225,7 @@ void PoDoFoBrowser::clear() { - m_filename = QString::null; + m_filename = QString(); setWindowTitle( tr("PoDoFoBrowser") ); labelStream->setText( QString::fromUtf8("") ); @@ -448,7 +448,7 @@ { // TODO FIXME XXX AUUGH! Encoding assumption like nothing ever // seen before! -// QString data = QString::fromAscii(pBuf, lLen); +// QString data = QString::fromLatin1(pBuf, lLen); QByteArray pArray(pBuf, lLen); QString data = m_codecForStream->toUnicode(pArray); textStream->setEnabled(true); @@ -507,7 +507,7 @@ const QFileInfo origFileInfo(origFileName); QDir tmpDir = QDir::temp(); const QString tmpFileName = QString::number(QCoreApplication::applicationPid()) - + QString::fromAscii("-") + + QString::fromLatin1("-") + origFileInfo.fileName(); tmpDir.remove(tmpFileName); bool success = false; @@ -692,7 +692,7 @@ m_bHasFindText = true; m_sFindText = dlgui.comboBoxText->currentText(); - m_findFlags = 0; + m_findFlags = QTextDocument::FindFlag(); if( dlgui.checkBoxCaseSensitive->isChecked() ) m_findFlags |= QTextDocument::FindCaseSensitively; @@ -749,7 +749,7 @@ QString sFind = dlgui.comboBoxText->currentText(); QString sReplace = dlgui.comboBoxReplace->currentText(); - QTextDocument::FindFlags findFlags = 0; + QTextDocument::FindFlags findFlags = QTextDocument::FindFlag();; if( dlgui.checkBoxCaseSensitive->isChecked() ) findFlags |= QTextDocument::FindCaseSensitively; @@ -1005,7 +1005,7 @@ void PoDoFoBrowser::toolsToHex() { - std::auto_ptr<PdfFilter> hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); + std::unique_ptr<PdfFilter> hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); char* pBuffer = NULL; pdf_long lLen = 0; @@ -1013,7 +1013,7 @@ this, tr("PoDoFoBrowser: To Hex"), tr("Please input a string (7-bit ASCII only):") ); - if( QString::null != text ) + if( QString() != text ) { try { // FIXME XXX TODO big bad encoding assumption @@ -1023,8 +1023,8 @@ return; } - // This ::fromAscii is safe since we're dealing with hex strings only. - text = QString::fromAscii( pBuffer, lLen ); + // This ::fromLatin1 is safe since we're dealing with hex strings only. + text = QString::fromLatin1( pBuffer, lLen ); QMessageBox::information( this, tr("PoDoFoBrowser"), tr("The string converted to hex:<br>") + text ); } } @@ -1031,7 +1031,7 @@ void PoDoFoBrowser::toolsFromHex() { - std::auto_ptr<PdfFilter> hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); + std::unique_ptr<PdfFilter> hexfilter = PdfFilterFactory::Create(ePdfFilter_ASCIIHexDecode); char* pBuffer = NULL; pdf_long lLen = 0; @@ -1039,7 +1039,7 @@ this, tr("PoDoFoBrowser: From Hex"), tr("Please input a hex string:") ); - if( QString::null != text ) + if( QString() != text ) { try { // This encoding assumption should be safe since we're reading hex strings @@ -1066,7 +1066,7 @@ obj->ToString(s); QMessageBox::information(this, tr("PDF code for selection"), - QString::fromAscii( s.c_str() ) ); + QString::fromLatin1( s.c_str() ) ); } void PoDoFoBrowser::helpAbout() Modified: podofobrowser/trunk/src/podofobrowser.h =================================================================== --- podofobrowser/trunk/src/podofobrowser.h 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofobrowser.h 2020-12-27 17:54:54 UTC (rev 2017) @@ -43,7 +43,7 @@ Q_OBJECT public: - PoDoFoBrowser( const QString & filename = QString::null ); + PoDoFoBrowser( const QString & filename = QString() ); ~PoDoFoBrowser(); private slots: Modified: podofobrowser/trunk/src/podofobrowserbase.ui =================================================================== --- podofobrowser/trunk/src/podofobrowserbase.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofobrowserbase.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> +<ui version="5.0"> <class>PoDoFoBrowserBase</class> <widget class="QMainWindow" name="PoDoFoBrowserBase"> <property name="geometry"> @@ -589,7 +589,7 @@ <connections> <connection> <sender>fileNewAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>fileNew()</slot> <hints> @@ -605,7 +605,7 @@ </connection> <connection> <sender>fileOpenAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>fileOpen()</slot> <hints> @@ -621,7 +621,7 @@ </connection> <connection> <sender>fileSaveAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>fileSave()</slot> <hints> @@ -629,7 +629,7 @@ <x>-1</x> <y>-1</y> </hint> - <hint type="destinationlabel"> + <hint type="destinationlabel" > <x>20</x> <y>20</y> </hint> @@ -637,7 +637,7 @@ </connection> <connection> <sender>fileSaveAsAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>fileSaveAs()</slot> <hints> @@ -653,7 +653,7 @@ </connection> <connection> <sender>fileExitAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>fileExit()</slot> <hints> @@ -669,7 +669,7 @@ </connection> <connection> <sender>helpAboutAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>helpAbout()</slot> <hints> @@ -685,7 +685,7 @@ </connection> <connection> <sender>toolsToHexAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>toolsToHex()</slot> <hints> @@ -701,7 +701,7 @@ </connection> <connection> <sender>toolsFromHexAction</sender> - <signal>activated()</signal> + <signal>triggered()</signal> <receiver>PoDoFoBrowserBase</receiver> <slot>toolsFromHex()</slot> <hints> Modified: podofobrowser/trunk/src/podofofinddlg.ui =================================================================== --- podofobrowser/trunk/src/podofofinddlg.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofofinddlg.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,4 +1,4 @@ -<ui version="4.0" > +<ui version="5.0" > <class>PoDoFoFindDlg</class> <widget class="QDialog" name="PoDoFoFindDlg" > <property name="geometry" > Modified: podofobrowser/trunk/src/podofogotodlg.ui =================================================================== --- podofobrowser/trunk/src/podofogotodlg.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofogotodlg.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,4 +1,4 @@ -<ui version="4.0" > +<ui version="5.0" > <class>PoDoFoGotoDlg</class> <widget class="QDialog" name="PoDoFoGotoDlg" > <property name="geometry" > Modified: podofobrowser/trunk/src/podofogotopagedlg.ui =================================================================== --- podofobrowser/trunk/src/podofogotopagedlg.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofogotopagedlg.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,4 +1,4 @@ -<ui version="4.0" > +<ui version="5.0" > <class>PoDoFoGotoPageDlg</class> <widget class="QDialog" name="PoDoFoGotoPageDlg" > <property name="geometry" > Modified: podofobrowser/trunk/src/podofoinfodlg.cpp =================================================================== --- podofobrowser/trunk/src/podofoinfodlg.cpp 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofoinfodlg.cpp 2020-12-27 17:54:54 UTC (rev 2017) @@ -42,22 +42,22 @@ QString unit; if(size < 1024.0) { - unit = QString::fromAscii("%1 B"); + unit = QString::fromLatin1("%1 B"); } else if(size < (1024.0 * 1024.0)) { size /= 1024.0 ; - unit = QString::fromAscii("%1 KB"); + unit = QString::fromLatin1("%1 KB"); } else if(size < (1024.0 * 1024.0 * 1024.0)) { size /= 1024.0 *1024.0; - unit = QString::fromAscii("%1 MB"); + unit = QString::fromLatin1("%1 MB"); } else { size /= 1024.0 * 1024.0 * 1024.0; - unit = QString::fromAscii("%1 GB"); + unit = QString::fromLatin1("%1 GB"); } QString filesize ( itemTemplate.arg ( tr ( "size" ) ) Modified: podofobrowser/trunk/src/podofoinfodlg.ui =================================================================== --- podofobrowser/trunk/src/podofoinfodlg.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofoinfodlg.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> +<ui version="5.0"> <class>PodofoInfoDlg</class> <widget class="QDialog" name="PodofoInfoDlg"> <property name="geometry"> Modified: podofobrowser/trunk/src/podoforeplacedlg.ui =================================================================== --- podofobrowser/trunk/src/podoforeplacedlg.ui 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podoforeplacedlg.ui 2020-12-27 17:54:54 UTC (rev 2017) @@ -1,4 +1,4 @@ -<ui version="4.0" > +<ui version="5.0" > <class>PoDoFoReplaceDlg</class> <widget class="QDialog" name="PoDoFoReplaceDlg" > <property name="geometry" > Modified: podofobrowser/trunk/src/podofoutil.cpp =================================================================== --- podofobrowser/trunk/src/podofoutil.cpp 2020-10-10 17:33:01 UTC (rev 2016) +++ podofobrowser/trunk/src/podofoutil.cpp 2020-12-27 17:54:54 UTC (rev 2017) @@ -2,8 +2,8 @@ #include <string> #include <iostream> #include <podofo/podofo.h> -#include <QtCore> -#include <QtGui> +#include <QString> +#include <QMessageBox> using namespace PoDoFo; void podofoError( const PdfError & eCode ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |