Hi PoDoFo maintainers,Recently we created github mirror for PoDoFo which also contains our patches: https://github.com/ispringsolutions/PoDoFo/commits/is-dev
Now we want to move some patches to upstream.
By default, PoDoFo writes log messages to stderr. It's unwanted behavior when we use it in GUI product (exception messages are logged separately, and we have no need to log "normal" messages). It's possible to disable logging by PdfError static method calls, however, these calls defined inline and cannot be used from DLL on Windows. In the other hand, we should use DLL on Windows since PoDoFo has LGPL license and our product isn't opensource.
Issue mentioned in stackoverflow question: http://stackoverflow.com/questions/34428642/podofo-writes-unwanted-stuff-to-stderr
This patch fixes issues with linking PdfError when PoDoFo built as DLL.
>From 6668fc011ed099e95733b04cdbed011f14c46ea8 Mon Sep 17 00:00:00 2001 From: Sergey Shambir <ssham...@yandex.ru> Date: Tue, 19 Jul 2016 09:48:08 +0300 Subject: [PATCH] [iSpring patch] Fixed issue in PdfError caused DLL linking error on Windows. --- src/base/PdfError.cpp | 20 ++++++++++++++++++++ src/base/PdfError.h | 8 ++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/base/PdfError.cpp b/src/base/PdfError.cpp index 6395313..055d66a 100644 --- a/src/base/PdfError.cpp +++ b/src/base/PdfError.cpp @@ -587,6 +587,16 @@ void PdfError::LogMessage( ELogSeverity eLogSeverity, const wchar_t* pszMsg, ... va_end( args ); } +void PdfError::EnableLogging( bool bEnable ) +{ + PdfError::s_LogEnabled = bEnable; +} + +bool PdfError::LoggingEnabled() +{ + return PdfError::s_LogEnabled; +} + void PdfError::LogErrorMessage( ELogSeverity eLogSeverity, const wchar_t* pszMsg, ... ) { va_list args; @@ -661,4 +671,14 @@ void PdfError::DebugMessage( const char* pszMsg, ... ) va_end( args ); } +void PdfError::EnableDebug( bool bEnable ) +{ + PdfError::s_DgbEnabled = bEnable; +} + +bool PdfError::DebugEnabled() +{ + return PdfError::s_DgbEnabled; +} + }; diff --git a/src/base/PdfError.h b/src/base/PdfError.h index b63c197..9b88e1e 100644 --- a/src/base/PdfError.h +++ b/src/base/PdfError.h @@ -393,11 +393,11 @@ class PODOFO_EXCEPTION_API_DOXYGEN PdfError { /** Enable or disable Logging * \param bEnable enable (true) or disable (false) */ - static void EnableLogging( bool bEnable ) { PdfError::s_LogEnabled = bEnable; } + static void EnableLogging( bool bEnable ); /** Is the display of debugging messages enabled or not? */ - static bool LoggingEnabled() { return PdfError::s_LogEnabled; } + static bool LoggingEnabled(); /** Log a message to the logging system defined for PoDoFo for debugging * \param pszMsg the message to be logged @@ -407,11 +407,11 @@ class PODOFO_EXCEPTION_API_DOXYGEN PdfError { /** Enable or disable the display of debugging messages * \param bEnable enable (true) or disable (false) */ - static void EnableDebug( bool bEnable ) { PdfError::s_DgbEnabled = bEnable; } + static void EnableDebug( bool bEnable ); /** Is the display of debugging messages enabled or not? */ - static bool DebugEnabled() { return PdfError::s_DgbEnabled; } + static bool DebugEnabled(); private: /** Log a message to the logging system defined for PoDoFo. -- 2.7.4
------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today.http://sdm.link/xeonphi
_______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users