Re: [Podofo-users] About fix for CVE-2017- 6845 (Was: Re: Next PoDoFo Release 0.9.6)

2018-02-22 Thread Dominik Seichter via Podofo-users
Hi zyx Yes that makes sense. I was also wandering why we do have logic checks only in debug. Would you be so kind and remove the #ifdef NDEBUG? i do not have acess to svn right now. Thanks Dominik Am 22.02.2018 09:30 schrieb "zyx" : > On Wed, 2018-02-21 at 21:51 +0100, Dominik

Re: [Podofo-users] About fix for CVE-2017- 6845 (Was: Re: Next PoDoFo Release 0.9.6)

2018-02-22 Thread zyx
On Wed, 2018-02-21 at 21:51 +0100, Dominik Seichter wrote: > It should always be legal to call this: > PODOFO_RAISE_LOGIC_IF( m_stack.empty(), "Can get current > graphicsstate!" ); > > As it translates to: > if( m_stack.empty() ) { > throw ... > } Hi, the macro is fine, the problem is

Re: [Podofo-users] Next PoDoFo Release 0.9.6

2018-02-22 Thread zyx
On Wed, 2018-02-21 at 22:44 +0100, Francesco Pretto wrote: > Can I send git formatted patches to the mailing list? Hi, git-formatted patches are perfectly fine (they generate unified diffs, which are also easy to read). Ideally include some description what and why you did in the patch.

[Podofo-users] Fwd: Check for preventing signatures from decryption not sufficient

2018-02-22 Thread F. E.
Hello dear podofo users, today i stumbled upon a parsing bug in PdfTokenizer::ReadDictionary. With SVN revision 1794, a check was added to prevent a signature content stream from being decrypted by comparing the dictionary type to "Sig". But this requires the type to be known/parsed beforehand,

Re: [Podofo-users] About fix for CVE-2017- 6845 (Was: Re: Next PoDoFo Release 0.9.6)

2018-02-22 Thread zyx
On Thu, 2018-02-22 at 09:38 +0100, Dominik Seichter wrote: > Would you be so kind and remove the #ifdef NDEBUG? i do not have > acess to svn right now. > Hi, sure thing, done as revision 1892: http://sourceforge.net/p/podofo/code/1892 Bye, zyx

[Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Francesco Pretto
This is also specified in the API documentation. Without the fix there was a crash trying to insert page at index 0 --- src/doc/PdfPagesTree.cpp | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/doc/PdfPagesTree.cpp b/src/doc/PdfPagesTree.cpp index 2ee8ea2..9d851d3

[Podofo-users] [PATCH 10/13] PdfVariant: Added SetString method

2018-02-22 Thread Francesco Pretto
--- src/base/PdfVariant.h | 25 + 1 file changed, 25 insertions(+) diff --git a/src/base/PdfVariant.h b/src/base/PdfVariant.h index f9217d8..fbd3c32 100644 --- a/src/base/PdfVariant.h +++ b/src/base/PdfVariant.h @@ -275,6 +275,14 @@ class PODOFO_API PdfVariant { *

[Podofo-users] [PATCH 13/13] PdfDictionary: Added support for range iteration

2018-02-22 Thread Francesco Pretto
Also added a convenience GetSize() method --- src/base/PdfDictionary.cpp | 10 ++ src/base/PdfDictionary.h | 16 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/base/PdfDictionary.cpp b/src/base/PdfDictionary.cpp index 65ed73a..d2e3da5 100644 ---

[Podofo-users] [PATCH] Fix compilation error including libidn in MSVC

2018-02-22 Thread Francesco Pretto
--- src/base/PdfEncrypt.cpp | 5 + 1 file changed, 5 insertions(+) diff --git a/src/base/PdfEncrypt.cpp b/src/base/PdfEncrypt.cpp index 115925f..06cf8bd 100644 --- a/src/base/PdfEncrypt.cpp +++ b/src/base/PdfEncrypt.cpp @@ -38,6 +38,11 @@ #ifdef PODOFO_HAVE_LIBIDN // AES-256 dependencies

[Podofo-users] [PATCH 3/3] PdfAnnotation: Added GetAppearanceStream method

2018-02-22 Thread Francesco Pretto
Returns found apperance object in the owner dictionary --- src/doc/PdfAnnotation.cpp | 37 - src/doc/PdfAnnotation.h | 10 +- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/doc/PdfAnnotation.cpp b/src/doc/PdfAnnotation.cpp index

[Podofo-users] [PATCH 08/13] PdfDictionary: Added efficient TryGetKey method

2018-02-22 Thread Francesco Pretto
--- src/base/PdfDictionary.cpp | 13 + src/base/PdfDictionary.h | 12 +++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/base/PdfDictionary.cpp b/src/base/PdfDictionary.cpp index b0be927..65ed73a 100644 --- a/src/base/PdfDictionary.cpp +++

[Podofo-users] [PATCH 03/13] PdfPainter: Removed unneed cast

2018-02-22 Thread Francesco Pretto
PdfImage is a PdfXObject --- src/doc/PdfPainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/PdfPainter.cpp b/src/doc/PdfPainter.cpp index 03a5d05..fc5c0de 100644 --- a/src/doc/PdfPainter.cpp +++ b/src/doc/PdfPainter.cpp @@ -1320,7 +1320,7 @@ void

[Podofo-users] [PATCH 09/13] PdfPage: Added SetMediaBox method

2018-02-22 Thread Francesco Pretto
--- src/doc/PdfPage.cpp | 13 + src/doc/PdfPage.h | 5 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/doc/PdfPage.cpp b/src/doc/PdfPage.cpp index e933732..d0437ee 100644 --- a/src/doc/PdfPage.cpp +++ b/src/doc/PdfPage.cpp @@ -105,10 +105,8 @@

[Podofo-users] [PATCH 06/13] PdfAnnotation: Removed duplicated set rect on constructor

2018-02-22 Thread Francesco Pretto
--- src/doc/PdfAnnotation.cpp | 4 1 file changed, 4 deletions(-) diff --git a/src/doc/PdfAnnotation.cpp b/src/doc/PdfAnnotation.cpp index a02f05d..f95e82c 100644 --- a/src/doc/PdfAnnotation.cpp +++ b/src/doc/PdfAnnotation.cpp @@ -92,10 +92,6 @@ PdfAnnotation::PdfAnnotation( PdfPage*

[Podofo-users] [PATCH 12/13] Added .editorconfig

2018-02-22 Thread Francesco Pretto
See http://editorconfig.org/ --- .editorconfig | 11 +++ 1 file changed, 11 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000..6dbc0b2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +[*.{cpp,h,hpp}]

[Podofo-users] [PATCH 00/13] Miscellaneous fixes and improvements

2018-02-22 Thread Francesco Pretto
It follows a series of patches with miscellaneous crash fixes and improvements to the API. Most of them should be straightforward. On some enums I added a convenience "Unknown" value following the convention often found in Podofo that Unknown=0xff. This is helpful for me when casting to other

[Podofo-users] [PATCH 01/13] Fix msvc source group for podofo project headers

2018-02-22 Thread Francesco Pretto
Header files must be added to ADD_LIBRARY() to be seen in MSVC --- src/CMakeLists.txt | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72f2f0f..06f277c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@

[Podofo-users] [PATCH 04/13] PdfAnnotation: Added SetRect

2018-02-22 Thread Francesco Pretto
--- src/doc/PdfAnnotation.cpp | 8 src/doc/PdfAnnotation.h | 7 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/doc/PdfAnnotation.cpp b/src/doc/PdfAnnotation.cpp index 941435b..a02f05d 100644 --- a/src/doc/PdfAnnotation.cpp +++ b/src/doc/PdfAnnotation.cpp @@

[Podofo-users] [PATCH 11/13] EPdfPageSize: Added convenience Unknown value using the 0xff convention

2018-02-22 Thread Francesco Pretto
--- src/base/PdfDefines.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/base/PdfDefines.h b/src/base/PdfDefines.h index 6f35be5..fcd8f23 100644 --- a/src/base/PdfDefines.h +++ b/src/base/PdfDefines.h @@ -381,7 +381,9 @@ enum EPdfPageSize { ePdfPageSize_A6,

[Podofo-users] [PATCH 02/13] PdfMemDocument::Load: Fix wrong use of memcpy instead of wmemcpy

2018-02-22 Thread Francesco Pretto
--- src/doc/PdfMemDocument.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/PdfMemDocument.cpp b/src/doc/PdfMemDocument.cpp index 04e5034..a7255ee 100644 --- a/src/doc/PdfMemDocument.cpp +++ b/src/doc/PdfMemDocument.cpp @@ -271,7 +271,7 @@ void

[Podofo-users] [PATCH 2/3] PdfSignatureField::SetAppearanceStream: Removed use of unuseful SetAppearanceStreamForObject method

2018-02-22 Thread Francesco Pretto
This was confusing: m_pObject is the annotation PdfObject --- src/doc/PdfSignatureField.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/PdfSignatureField.cpp b/src/doc/PdfSignatureField.cpp index 92a92d7..eb8d57e 100644 --- a/src/doc/PdfSignatureField.cpp +++

[Podofo-users] [PATCH 0/3] Improvements to annotations appearance API

2018-02-22 Thread Francesco Pretto
Currently the API support setting annotation appearance only from PdfXObject. This is arbitrarily limiting the API: the appearance can be set from a generic PdfObject. Also there's no accessibility method for the current set appearance. The patch series add overloads accepting a PdfObject. I

[Podofo-users] [PATCH 1/3] PdfAnnotation: Allow set appearance from PdfObject

2018-02-22 Thread Francesco Pretto
Also reflected on PdfCheckbox and PdfSignature --- src/doc/PdfAnnotation.cpp | 24 +--- src/doc/PdfAnnotation.h | 11 ++- src/doc/PdfField.cpp | 18 ++ src/doc/PdfField.h| 18 --

Re: [Podofo-users] [PATCH 08/13] PdfDictionary: Added efficient TryGetKey method

2018-02-22 Thread Francesco Pretto
I would like to add the the lack of this method makes PoDoFo quite inefficient in many code paths because of the intrinsic double lookup of the pattern "if (haskey) then getkey". Also PdfDictionary::GetKey() is surprisingly doing a double lookup inside (this is screaming for a optmization fix)!

[Podofo-users] Watermarks?

2018-02-22 Thread Olivier Mascia
Dear all, How about watermarking pages? Either with text, images or PDF pages? I mean, take two existing PDF files A and B. Update file A, placing content of page B.2 so it displays underneath (or over) page A.1 existing content? Or given PDF file A, add text or images underneath (or over)

Re: [Podofo-users] Watermarks?

2018-02-22 Thread Matthew Brincke
Hello Olivier, hello all, On 22 February 2018 at 17:54 Olivier Mascia wrote: > > > Dear all, > > How about watermarking pages? > Either with text, images or PDF pages? > I'm no expert for "watermarking", especially about securing/hardening against removal of such a watermark

Re: [Podofo-users] Watermarks?

2018-02-22 Thread Olivier Mascia
> Le 22 févr. 2018 à 21:47, Matthew Brincke a écrit : > >> How about watermarking pages? >> Either with text, images or PDF pages? >> > I'm no expert for "watermarking", especially about securing/hardening > against removal of such a watermark (e.g. e-books marked with

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Matthew Brincke
Hello Francesco, hello all, > On 22 February 2018 at 12:20 Francesco Pretto wrote: > > > This is also specified in the API documentation. Without the fix > there was a crash trying to insert page at index 0 where did it crash? What kind of crash was it, please? I've looked in

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Francesco Pretto
On 23 February 2018 at 00:13, Matthew Brincke wrote: > where did it crash? What kind of crash was it, please? I've looked in > the source code and couldn't find a reason for a crash, the index -1 > for InsertPage(int, PdfPage*) just means "insert before the first page". >

Re: [Podofo-users] [PATCH 05/13] PdfPagesTree::InsertPage: Fix "atIndex" is really a 0-based index

2018-02-22 Thread Matthew Brincke
Hello Francesco, hello all, > On 23 February 2018 at 01:05 Francesco Pretto wrote: > > > On 23 February 2018 at 00:13, Matthew Brincke wrote: > > where did it crash? What kind of crash was it, please? I've looked in > > the source code and couldn't find a

Re: [Podofo-users] [PATCH 03/13] PdfPainter: Removed unneed cast

2018-02-22 Thread Matthew Brincke
Hello Francesco, hello all, > On 22 February 2018 at 12:20 Francesco Pretto wrote: > > > PdfImage is a PdfXObject > --- > src/doc/PdfPainter.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/doc/PdfPainter.cpp b/src/doc/PdfPainter.cpp >

Re: [Podofo-users] [PATCH 0/1] More flexibility when using PoDoFo as a static library

2018-02-22 Thread zyx
On Thu, 2018-02-22 at 13:05 +0100, Francesco Pretto wrote: > The current patch convert headers to really use > relative paths, allowing to use podofo with #include > notation. Hi, you should discuss such invasive changes before suggesting them and sending them to the list. Your changes