ENH: Add writer.pdf_header property (getter and setter)#1038
Merged
MartinThoma merged 10 commits intomainfrom Jun 29, 2022
Merged
ENH: Add writer.pdf_header property (getter and setter)#1038MartinThoma merged 10 commits intomainfrom
MartinThoma merged 10 commits intomainfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1038 +/- ##
==========================================
+ Coverage 89.59% 89.62% +0.02%
==========================================
Files 24 24
Lines 4441 4462 +21
Branches 917 922 +5
==========================================
+ Hits 3979 3999 +20
Misses 314 314
- Partials 148 149 +1
Continue to review full report at Codecov.
|
MasterOdin
reviewed
Jun 29, 2022
Member
There was a problem hiding this comment.
From the linked issue, should we take the max of version between writer and new page automatically as part of _add_page function, to make usage of this a bit more transparent to users? Simple test for this new functionality could then be:
def test_pdf_header():
writer = PdfWriter()
assert writer.pdf_header == b"%PDF-1.3"
reader = PdfReader(os.path.join(RESOURCE_ROOT, "crazyones.pdf"))
writer.add_page(reader.pages[0])
assert writer.pdf_header == b"%PDF-1.5"
writer.pdf_header = b"%PDF-1.6"
assert writer.pdf_header == b"%PDF-1.6"
written ones Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
MartinThoma
added a commit
that referenced
this pull request
Jun 30, 2022
New Features (ENH): - Add writer.pdf_header property (getter and setter) (#1038) Performance Improvements (PI): - Remove b_ call in FloatObject.write_to_stream (#1044) - Check duplicate objects in writer._sweep_indirect_references (#207) Documentation (DOC): - How to surppress exceptions/warnings/log messages (#1037) - Remove hyphen from lossless (#1041) - Compression of content streams (#1040) - Fix inconsistent variable names in add-watermark.md (#1039) - File size reduction - Add CHANGELOG to the rendered docs (#1023) Maintenance (MAINT): - Handle XML error when reading XmpInformation (#1030) - Deduplicate Code / add mutmut config (#1022) Code Style (STY): - Use unnecessary one-line function / class attribute (#1043) - Docstring formatting (#1033) Full Changelog: 2.4.0...2.4.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #162