Closed luketudge closed 11 months ago
Thanks for flagging this, @luketudge! It does look like things got a bit mixed up over the course of some changes. I'm proposing fixing the issue via this commit: https://github.com/jsvine/pdfplumber/commit/ba58e16450f86066a1fe9aceaccc0c2e7b262a14
It (re-)adds the missing Page.close()
method, has PDF.close()
close all pages, and adjusts the documentation. Does this seem right to you? Or still a bit confusing/wrong?
@jsvine Great! This looks exactly right. Thanks for picking it up so quickly.
Super! Closing this as fixed via https://github.com/jsvine/pdfplumber/commit/ba58e16450f86066a1fe9aceaccc0c2e7b262a14
Something is not right about the main README and perhaps needs updating.
The explanation of
PDF.close()
here mentions clearing the cache forPage
objects. But callingPDF.close()
does not clear the cache for the individual pages. To do that, we needPage.flush_cache()
. This part of the README also suggests that.flush_cache()
is deprecated in favor of.close()
, butPage
objects do not have a.close()
method.Maybe the documentation of
PDF
andPage
has gotten mixed up? Clearer would be to explain here what.close()
does for the PDF object, and to add documentation of cache clearing for Page objects to a different section.