New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve IndirectObject when it refers to a free entry. #1054
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1054 +/- ##
==========================================
- Coverage 90.92% 90.85% -0.08%
==========================================
Files 24 24
Lines 4508 4516 +8
Branches 921 923 +2
==========================================
+ Hits 4099 4103 +4
- Misses 267 269 +2
- Partials 142 144 +2
Continue to review full report at Codecov.
|
Thank you for the PR ❤️ I'll review it tomorrow 🤞 |
I think your comment #1034 (comment) is super helpful. I would use the following commit message:
|
The part that I really don't get is what the free entries are good for. They are not used, right? So why are they stored in the first place? What are those generation numbers good for? |
I think for example if you want quickly delete something you don't need to load whole document for renumbering. Only delete wanted data and mark entry free and update other offsets according deleted data in xref table. And I understood that you can use generation if you edit PDF-file to show changed etc. If you have same entry multiple times in xref you should pick greatest generation by default. I didn't go deep in that section. |
Thank you for the contribution ❤️ This fix will be part of |
New Features (ENH): - Add PdfReader.xfa attribute (#1026) Bug Fixes (BUG): - Wrong page inserted when PdfMerger.merge is done (#1063) - Resolve IndirectObject when it refers to a free entry (#1054) Developer Experience (DEV): - Added {posargs} to tox.ini (#1055) Maintenance (MAINT): - Remove PyPDF2._utils.bytes_type (#1053) Testing (TST): - Scale page (indirect rect object) (#1057) - Simplify pathlib PdfReader test (#1056) - IndexError of VirtualList (#1052) - Invalid XML in xmp information (#1051) - No pycryptodome (#1050) - Increase test coverage (#1045) Code Style (STY): - DOC of compress_content_streams (#1061) - Minimize diff for #879 (#1049) Full Changelog: 2.4.1...2.4.2
Example to resolve IndirectObject when it refers to a free entry.
This could resolve issues #1034 and #521 .