|
Hi, thank you very much. I have now got some AESV2 encrypted PDF, that are created with Acrobat X. These currently crash in PoDoFo because they have multiple XRef streams and XRef streams are never encrypted. But in PdfParser::ReadObjectsInternal m_pEncrypt is set for these XRef objects. I have added a patch to skip all XRef objects in PdfParser::ReadObjectsInternal. With that AESV2 encryption from Acrobat X should work. Bye Andreas Am 09.03.2014 14:18, schrieb zyx:
--
Andreas Brzesowsky
dots Software GmbH http://www.dots.de
Amtsgericht (District Court): Berlin Charlottenburg HRB 65201
| ||||||
Index: src/base/PdfParser.cpp
===================================================================
--- src/base/PdfParser.cpp (revision 1583)
+++ src/base/PdfParser.cpp (working copy)
@@ -980,6 +980,13 @@
pObject->SetLoadOnDemand( m_bLoadOnDemand );
try {
pObject->ParseFile( m_pEncrypt );
+ PdfObject* pObjType = pObject->IsDictionary() ?
pObject->GetDictionary().GetKey( PdfName::KeyType ) : 0;
+ if( pObjType && pObjType->IsName() &&
pObjType->GetName() == "XRef" ) {
+ // Never add the XRef to m_vecObjects
because if it has a stream it is not encrypted
+ // (So setting m_pEncrypt for it would
throw exception if the stream is read later on.)
+ delete pObject;
+ continue;
+ }
nLast = pObject->Reference().ObjectNumber();
/*
------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech
_______________________________________________ Podofo-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/podofo-users




