Try to make pdfinfo less obnoxious by printing too many decimals
This commit is contained in:
@@ -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
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user