jsvine / pdfplumber

Plumb a PDF for detailed information about each char, rectangle, line, et cetera — and easily extract text and tables.
MIT License
6.57k stars 659 forks source link

Handle integer/floating type metadata values #298

Closed samkit-jain closed 3 years ago

samkit-jain commented 3 years ago

This is a quick fix for issue #297

A test is yet to be added as I have been unable to edit a metadata value and store it as an integer type. It keeps getting saved as a string. If any of the watchers of this PR can modify the metadata of any of the available PDFs in the repo such that the data type becomes an integer or a float, it would be much appreciated and I'll add a test case for it as well.

codecov[bot] commented 3 years ago

Codecov Report

Merging #298 into develop will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #298   +/-   ##
========================================
  Coverage    97.47%   97.47%           
========================================
  Files           10       10           
  Lines         1190     1190           
========================================
  Hits          1160     1160           
  Misses          30       30           
Impacted Files Coverage Δ
pdfplumber/pdf.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 954dc94...3030765. Read the comment docs.

jsvine commented 3 years ago

Many thanks, @samkit-jain! And, yes, if anyone has a PDF that could serve as a test case, that would be great. In the meantime, I’ll see if I can find one.

samkit-jain commented 3 years ago

@jsvine Updated the PR with the test case. Also acknowledged @prgx-csmith01 in the commit message.