Good catch. Here’s the patch with that code added back. From: Michal Sudolsky <[email protected]> Sent: Thursday, February 27, 2020 2:05 PM To: John Senneker <[email protected]> Cc: zyx <[email protected]>; podofo-users <[email protected]> Subject: Re: [Podofo-users] [External] Re: Patch for ignoring broken objects
Hi,
There is missing this part of original patch:
@@ -1304,7 +1306,15 @@
std::ostringstream oss;
oss << "Loading of object " << nObjNo << " 0 R failed!" << std::endl;
- PODOFO_RAISE_ERROR_INFO( ePdfError_NoObject, oss.str().c_str() );
+ if ( m_bIgnoreBrokenObjects )
+ {
+ PdfError::LogMessage( eLogSeverity_Error, oss.str().c_str() );
+ return;
+ }
+ else
+ {
+ PODOFO_RAISE_ERROR_INFO( ePdfError_NoObject, oss.str().c_str() );
+ }
}
On Thu, Feb 27, 2020 at 7:38 PM John Senneker
<[email protected]<mailto:[email protected]>> wrote:
Hi zyx,
Here's a patch that:
* makes PdfParser::m_bIgnoreBrokenObjects a static member, which can be changed
by calling the existing setter and getter methods (which are now static).
* removes the code in PdfParser::Init() that set m_bIgnoreBrokenObjects to false
* makes the default for the new static member true
The new patch makes no changes to things other than PdfParser. So the API for
people who don't want to ignore broken objects would be to call
PdfParser::SetIgnoreBrokenObjects() before calling PdfMemDocument::Load(), or
whatever else they're doing.
I think this is what you and Michal were suggesting, but if I've misunderstood
please let me know!
--
JS
-----Original Message-----
From: zyx <[email protected]<mailto:[email protected]>>
Sent: Thursday, February 27, 2020 1:55 AM
To: podofo-users
<[email protected]<mailto:[email protected]>>
Cc: John Senneker <[email protected]<mailto:[email protected]>>
Subject: Re: [Podofo-users] [External] Re: Patch for ignoring broken objects
On Wed, 2020-02-26 at 19:32 +0100, Michal Sudolsky wrote:
> Unless someone really needs to use different settings in different
> threads for some reason (now or in future).
Hi,
I agree and I'd say it'll be a minority of the users, if any. Let's try with
the simplest method, with the static variable (and methods to get/set the
value) in PdfParser.
John, would you mind to update your patch in this regard, please? I'd like to
give you the credits for the change, as it is your initiative, thus it deserves
it. Check the recent messages in this thread for the suggested changes.
Thanks and bye,
zyx
____________________________________________________________
Electronic mail messages entering and leaving Arup business systems are scanned
for viruses and acceptability of content.
_______________________________________________
Podofo-users mailing list
[email protected]<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/podofo-users<https://secure-web.cisco.com/1-_RdAs0iitkb3OoEgI534mudi4mjJBEoiNoAEMsoUs2YPlr4Ri4UCg6vCfof_hJl4wRGh2MkdIv3S-3GLSPfq_sGLLPYYbsgT9lyqUuYnLDu76ABXblsHpsf9gEaPmXtLX7kH9iCf6IDowMyT2T3SoINnXo3HrTIt7Afy_YaM54ZmDe2KXG_qt5dVbr6OFx6nLIY-rCvx1KuyNm0L_Zbhz1LMUNmc5tynCIEotRlZvrxdcfsRhLNVycjJYn3ayCYB-TSKpal4tDoxODFJkQGQdEk0gYBoUTs4O7ru8s6sLC_ayGyJv_wduGvJzJNelxsRqNpOxm9_a4ofYZmhw3g6Q/https%3A%2F%2Flists.sourceforge.net%2Flists%2Flistinfo%2Fpodofo-users>
PoDoFo-ignore-broken-objects_updated5_static.patch
Description: PoDoFo-ignore-broken-objects_updated5_static.patch
_______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users
