Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: py-pdf/pypdf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.4.0
Choose a base ref
...
head repository: py-pdf/pypdf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.4.1
Choose a head ref
  • 14 commits
  • 28 files changed
  • 5 contributors

Commits on Jun 28, 2022

  1. DOC: Add CHANGELOG to the rendered docs (#1023)

    Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
    MartinThoma and MasterOdin authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    c7d2450 View commit details
    Browse the repository at this point in the history
  2. PI: Check duplicate objects in writer._sweep_indirect_references (#207)

    This check can reduce the file size significantly when writing PDFs and there are objects used multiple times, for example images.
    
    If you read- and write a file again, this can already reduce the file size:
    
    ```python
    from PyPDF2 import PdfReader, PdfWriter
    
    reader = PdfReader("big-old-file.pdf")
    writer = PdfWriter()
    
    for page in reader.pages:
        writer.add_page(page)
    
    writer.add_metadata(reader.metadata)
    
    with open("smaller-new-file.pdf", "wb") as fp:
        writer.write(fp)
    ```
    
    For the following files, the size was reduced significantly:
    
    * https://corpora.tika.apache.org/base/docs/govdocs1/958/958893.pdf : 5.7 MB ➔ 0.8 MB (-4.9 MB / -86%)
    * https://corpora.tika.apache.org/base/docs/govdocs1/949/949428.pdf : 6.7 MB ➔ 1.9 MB (-4.8 MB / -72%)
    * https://corpora.tika.apache.org/base/docs/govdocs1/911/911140.pdf : 8.8 MB ➔ 4.3 MB (-4.5 MB / -51%)
    
    Co-authored-by: Harry Karvonen <harry.karvonen@onebyte.fi>
    Hatell and Harry Karvonen authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    ed832b3 View commit details
    Browse the repository at this point in the history
  3. STY: Docstring formatting (#1033)

    See PEP-257 for some guides.
    
    flake8-naming was used to find those spots.
    
    The "rtype" (return type) was removed from the docstrings as it already is in the type annotation in a more readable way + linked with the used type. It's also checked by mypy in the function signature.
    MartinThoma authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    a89ff74 View commit details
    Browse the repository at this point in the history
  4. DOC: File size reduction

    MartinThoma committed Jun 28, 2022
    Configuration menu
    Copy the full SHA
    2c8914e View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2022

  1. Configuration menu
    Copy the full SHA
    08c54d9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f2ffa7a View commit details
    Browse the repository at this point in the history
  3. DOC: Remove hyphen from lossless (#1041)

    Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
    MasterOdin authored Jun 29, 2022
    Configuration menu
    Copy the full SHA
    0215cc7 View commit details
    Browse the repository at this point in the history
  4. ENH: Add writer.pdf_header property (getter and setter) (#1038)

    When writing a PDF, set the version to the highest PDF version of the
    written ones
    
    Closes #162
    
    Co-authored-by: Matthew Peveler <matt.peveler@gmail.com>
    MartinThoma and MasterOdin authored Jun 29, 2022
    Configuration menu
    Copy the full SHA
    eedf0e0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a85c7e7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d1f2ed2 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2022

  1. Configuration menu
    Copy the full SHA
    84c3e33 View commit details
    Browse the repository at this point in the history
  2. PI: Remove b_ call in FloatObject.write_to_stream (#1044)

    Also in writer.encrypt
    MartinThoma authored Jun 30, 2022
    Configuration menu
    Copy the full SHA
    f1281b9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    97f36bd View commit details
    Browse the repository at this point in the history
  4. REL: 2.4.1

    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
    MartinThoma committed Jun 30, 2022
    Configuration menu
    Copy the full SHA
    66f00fc View commit details
    Browse the repository at this point in the history
Loading