Try to make pdfinfo less obnoxious by printing too many decimals

This commit is contained in:
Jim Barlow
2015-07-25 02:47:59 -07:00
parent 151eb05377
commit 42cd683ec0
2 changed files with 2 additions and 3 deletions
-2
View File
@@ -277,8 +277,6 @@ def repair_pdf(
log.info(pdfinfo)
# pageno, width_pt, height_pt = map(int, options.page_info.split(' ', 3))
# pageinfo = pdf_get_pageinfo(options.input_file, pageno, width_pt, height_pt)
# if not pageinfo['images']:
# # If the page has no images, then it contains vector content or text
+2 -1
View File
@@ -3,7 +3,7 @@
from subprocess import Popen, PIPE
import PyPDF2 as pypdf
from decimal import Decimal
from decimal import Decimal, getcontext
FRIENDLY_COLORSPACE = {
@@ -110,4 +110,5 @@ def _pdf_get_pageinfo(infile, page: int):
def pdf_get_all_pageinfo(infile):
pdf = pypdf.PdfFileReader(infile)
getcontext().prec = 6
return [_pdf_get_pageinfo(infile, n) for n in range(pdf.numPages)]