I have a large set of PDFs that are created in different devices and applications. I just need to know if a PDF is flat/flattened or not. I'd prefere solutions that are implementable using Python or Node.js, but any posix CLI tool would also be helpful.
I would appreciate any suggestions even if it works most of the times.
Update
Since it's asked in the comments about my definition of a flat PDF, I'd add two definitions:
- Definition 1: a PDF is flat if it only has one layer.
- Definition 2: a PDF is flat if it doesn't have any interactive elements.
Any solution that solves the problem either for definition 1 or 2 is fine.
Use PyPDF2 library