From ec682539da243386d1a4a1cf6dcd1d28f1a7a72a Mon Sep 17 00:00:00 2001 From: Jonathan J Hunt Date: Mon, 7 Mar 2011 15:11:31 +1000 Subject: [PATCH] Optimized memory usage in TextConverter by ignoring all drawing commands. --- pdfminer/converter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdfminer/converter.py b/pdfminer/converter.py index f916360..0b6696f 100644 --- a/pdfminer/converter.py +++ b/pdfminer/converter.py @@ -192,6 +192,14 @@ class TextConverter(PDFConverter): self.write_text('\f') return + # Some dummy functions to save memory/CPU when all that is wanted is text. + # This stops all the image and drawing ouput from being recorded and taking + # up RAM. + def render_image(self, name, stream): + pass + def paint_path(self, gstate, stroke, fill, evenodd, path): + pass + ## HTMLConverter ##