Comments (3)
Thank you for the research. Please also attach all the working and non working pdfs so they will be easily inspectable. This is an interesting topic but it's low priority for me and I don't have the resources to do it, right now.
from podofo.
ok I found a sample secured pdf here
These the results:
samplesecured.pdf
samplesecured-Signed-pdfbox.pdf
samplesecured-Signed-podofo.pdf
from podofo.
Hi, I did not forget! I haven't found a solution but I hope to give some useful hints.
Looking at the samplesecured.pdf
and the two files signed by pdfbox and by PoDoFo the substantial difference is represented by the object:
6 1 obj
<</CF<</StdCF<</AuthEvent/DocOpen/CFM/AESV3/Length 32>>>>/Filter/Standard/Length 256/O<9EF36ED0D632E6D2F520D564ADDDF94FB3793E667832EBBFC977E0A13AB77A313DF4A2824721DC8FAF533F9B3599DBCC>/OE<3526E597E1D35623A92C61FF651EBE06C541B929C16EDF0106E869F218297E83>/P -3392/Perms<9C2A1F313E4E64608091C22711F6D473>/R 5/StmF/StdCF/StrF/StdCF/U<D2CFC4C207107A06F09ED9EE0F31E1A38B72A3048030F45D88518668F240538291B2B8EB03D7D60C3241776714CB4436>/UE<91D91A1B147CAC7DFE4B24A03A25297B71C5745DE8A387F7461A0F2F815B0AB5>/V 5>>
This object is created by PoDoFo following the
void PdfEncryptSHABase::CreateEncryptionDictionary(PdfDictionary& dictionary) const
and is used to create later:
24 1 obj
<</Type/XRef/Encrypt 6 1 R/Filter/FlateDecode/ID[<CC5 [...]
Why is the 6 1 obj
created?
How does pdfbox use the 23 0 obj
directly?
A few info extracted with podofo:
void PdfParserObject::checkReference(PdfTokenizer& tokenizer)
DEBUG: The PDF file is encrypted
WARNING: Found object with reference 0 0 R different than reported 23 0 R in XRef sections
void PdfMemDocument::initFromParser(PdfParser& parser)
DEBUG: <</Type/XRef/Encrypt 23 0 R/Filter/FlateDecode/ID[<CC56D8A7F574DE7ED75787D94BF65288><CC56D8A7F574DE7ED75787D94BF65288>]/Index[ 2 18 21 4]/Info 2 0 R/Length 76/Root 21 0 R/Size 25/W[ 1 2 1]>>
Trying to open the signed file
PoDoFo encountered an error. Error: 7PdfErrorCode::InternalLogic Error Description: An internal error occurred. Callstack: #0 Error Source : main/PdfParser.cpp: 97 Information: Unable to load objects from file
#1 Error Source : main/PdfParserObject.cpp: 96 Information: Unable to parse the stream for object 22 0 R
#2 Error Source : main/PdfEncrypt.cpp: 404 Information: Error AES-decryption data padding
I tried to see what the competitors are doing too. The closest to PoDoFo is MuPdf!
Here instead the pdfbox encryption module
from podofo.
Related Issues (20)
- legacy.dll not copied HOT 10
- cmap generated by PdfDynamicEncoding is displayed differently in different readers HOT 20
- Freetype font management thread-safety HOT 1
- Segmentation fault when trying to Load image HOT 4
- Images are skewed HOT 1
- help with signing documents HOT 1
- Extract PDF file results in a garbled code HOT 8
- Please clarify license information for the following files HOT 3
- please provide instructions on how to create a PdfSignature HOT 2
- PdfErrorCode::OutOfMemory, PoDoFo is out of memory. in Signer.ComputeSignatureSequential({ }, Buff, true); HOT 6
- Is it possible to set the specified page not to be copied? HOT 1
- GetPageAt;ExtractTextTo: When the number of PDF pages increases linearly, the cost of both methods increases exponentially HOT 4
- FT_Load_Sfnt_Table, the judgment of return value HOT 1
- Question: Trying to add Marked Content and reshuffle OCG's
- fails to compile on msys2/mingw HOT 13
- Unable to load legacy providers in OpenSSL >= 3.x.x HOT 4
- Program received signal SIGABRT, Aborted HOT 3
- how to remove freeobject
- Question: Migration to 0.10.x - What happend to PdfField? HOT 3
- helloworld does not compile with libxml2 v2.12.6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from podofo.