Replies: 2 comments 6 replies
-
pdfplumber converts floating point values to Decimal objects here, using pdfplumber/pdfplumber/utils.py Lines 149 to 162 in de767c3 The precision is, by default, set to Lines 18 to 29 in de767c3 In my experience this default setting has not posed a problem but, of course, your mileage may vary.
There is (or should be) no number-precision difference between the command-line output and what you would get from using the Python library directly. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update -- glad this made its way in.
I've been pulled away from the project that was going to have me use
pdfplumber. Hopefully I'll be able to find my way back sometime this year.
Rob
…On Thu, Dec 23, 2021 at 7:11 PM Jeremy Singer-Vine ***@***.***> wrote:
Thank you again for this suggestion, @ramcdona
<https://github.com/ramcdona>. And an update: As of version 0.6.0,
pdfplumber no longer uses decimalization. It also allows a --precision
argument to be passed to the pdfplumber CLI.
—
Reply to this email directly, view it on GitHub
<#346 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKETQDJHFLTXHOJG6AGQCTUSPQE5ANCNFSM4XEG5ZYQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Is there any rounding or formatting of floating point values that occurs when pdfplumber extracts line, rect, curve?
The floating point numbers seem to typically have three digits after the decimal point. Is that the full extent of the information contained in the PDF file, or has some rounding or formatting been done by pdfplumber along the way? If there has been some control on precision, is there an option to increase the precision?
I'm presently using the command line pdfplumber program and writing out *.csv files. It certainly may be that precision is truncated when writing the *.csv that is preserved in the json or if I were to access the library directly from Python.
Beta Was this translation helpful? Give feedback.
All reactions