Re: [Podofo-users] SVN commit 1587 broke ability to parse several PDFs

2014-06-30 Thread Dennis Jenkins
On Mon, Jun 30, 2014 at 3:10 PM, zyx  wrote:

>
> Hi,
> thanks for a quick testing. I committed the patch as r1648 [1]. If
> you'll find time and give it more thorough testing by Friday, then
> it'll be great (you know, just in case it has any side-effects).
> Thanks again and bye,
> zyx
>
> [1] http://sourceforge.net/p/podofo/code/1648
>

Hello,

   r1648 works fine for me, for both my quick parser test and for my full
suite of unit tests for my own project.  Thank you!
--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] SVN commit 1587 broke ability to parse several PDFs

2014-06-30 Thread zyx
On Mon, 2014-06-30 at 14:57 -0500, Dennis Jenkins wrote:
> With your patch applied to a clean checkout of rev 1646, my test 
> suite can now open every PDF that I have (various tax forms from 
> 2009 to current).  I have not attempted to make use of the contents 
> of the files that previously failed to parse, so I do not know if 
> they are fully intact (in PoDoFo's internal model).  My quick+dirty 
> testing tool can count the number of pages in these PDFs though 
> (seems ok).

Hi,
thanks for a quick testing. I committed the patch as r1648 [1]. If 
you'll find time and give it more thorough testing by Friday, then 
it'll be great (you know, just in case it has any side-effects).
Thanks again and bye,
zyx

[1] http://sourceforge.net/p/podofo/code/1648


-- 
http://www.litePDF.cz i...@litepdf.cz


--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] SVN commit 1587 broke ability to parse several PDFs

2014-06-30 Thread Dennis Jenkins
On Mon, Jun 30, 2014 at 2:29 PM, zyx  wrote:

> On Sun, 2014-06-29 at 18:56 +0200, zyx wrote:
> > I think of reverting the patch, to support those "probably broken"
> > files, but I'd like to hear from you too, whether the file is truly
> > broken.
>
> Hi,
> Dennis, could you try with the attached patch, preferably on current
> trunk, please? It seems to survive on the file you gave a link to, but
> I only tried to open it, not to modify in it or read its objects.
> Thanks and bye,
> zyx
>
>
Hello Zyx,

With your patch applied to a clean checkout of rev 1646, my test suite
can now open every PDF that I have (various tax forms from 2009 to
current).  I have not attempted to make use of the contents of the files
that previously failed to parse, so I do not know if they are fully intact
(in PoDoFo's internal model).  My quick+dirty testing tool can count the
number of pages in these PDFs though (seems ok).
--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users


Re: [Podofo-users] SVN commit 1587 broke ability to parse several PDFs

2014-06-30 Thread zyx
On Sun, 2014-06-29 at 18:56 +0200, zyx wrote:
> I think of reverting the patch, to support those "probably broken"
> files, but I'd like to hear from you too, whether the file is truly
> broken.

Hi,
Dennis, could you try with the attached patch, preferably on current 
trunk, please? It seems to survive on the file you gave a link to, but 
I only tried to open it, not to modify in it or read its objects.
Thanks and bye,
zyx


-- 
http://www.litePDF.cz i...@litepdf.cz
Index: src/base/PdfParser.cpp
===
--- src/base/PdfParser.cpp	(revision 1645)
+++ src/base/PdfParser.cpp	(working copy)
@@ -836,8 +836,18 @@ void PdfParser::ReadXRefStreamContents(
 // Check for a previous XRef stream
 if(xrefObject.HasPrevious()) 
 {
-m_nIncrementalUpdates++;
-this->ReadXRefStreamContents( xrefObject.GetPreviousOffset(), bReadOnlyTrailer );
+try {
+m_nIncrementalUpdates++;
+this->ReadXRefStreamContents( xrefObject.GetPreviousOffset(), bReadOnlyTrailer );
+} catch(PdfError &e) {
+/* Be forgiving, the error happens when an entry in XRef stream points
+   to a wrong place (offset) in the PDF file. */
+if( e != ePdfError_NoNumber )
+{
+e.AddToCallstack( __FILE__, __LINE__ );
+throw e;
+}
+}
 }
 }
 
--
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft___
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users