smalot / pdfparser

PdfParser, a standalone PHP library, provides various tools to extract data from a PDF file.
GNU Lesser General Public License v3.0
2.3k stars 534 forks source link

Ignore encryption #653

Closed unixnut closed 7 months ago

unixnut commented 7 months ago

Type of pull request

About

In some cases PDF files may be internally marked as encrypted even though the content is not encrypted and can be read.

This MR provides a config option to inform the PDF parser to ignore the encryption and attempt to read the PDF anyway.

This therefore provides a work around for the following issues:

Thanks to @DivineOmega for making the original pull request.

(PHP-CS-Fixer has not been run.)

unixnut commented 7 months ago

PHP-CS-Fixer has been run successfully.

All tests passing including new ones in tests/PHPUnit/Integration/EncryptionTest.php

unixnut commented 7 months ago

@k00ni Looks like there were pre-existing PHP-CS-Fixer violations in the code; I ignored those because I assumed they were OK. (And just fixed ones in files I added/changed.) Might have come from PR 632 commits.

Any chance you could triage these, please?

k00ni commented 7 months ago

@unixnut thank you for this pull request. I am very busy these days, but I will try to get back to you until next week. Only skimmed your code, but it looks great so far.

unixnut commented 7 months ago

More re. PHP-CS-Fixer:

Except the one I fixed, I believe all of these are out of scope for the PR.

k00ni commented 7 months ago

CS related stuff doesn't really matter, because I will clean/correct it myself locally, if needed. The CI stuff is important and there are no problems in your code. Thank you for investing extra time on that :+1:

unixnut commented 7 months ago

Hi, @k00ni Sorry to bug you, but it looks like the PR is ready to approve. Any ideas when you will have merged it and released a new version? This is so I can give an update to my client.

k00ni commented 7 months ago

@unixnut: https://github.com/smalot/pdfparser/releases/tag/v2.8.0-RC2