From 2cb8e55f1d9edb67a835560b582592fe0dfa0193 Mon Sep 17 00:00:00 2001 From: josch Date: Fri, 6 Mar 2015 19:16:36 +0100 Subject: [PATCH] output pdf image size with four significant digits --- src/img2pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/img2pdf.py b/src/img2pdf.py index 21067b1..c8ef93c 100755 --- a/src/img2pdf.py +++ b/src/img2pdf.py @@ -163,7 +163,7 @@ class pdfdoc(object): # Inverts all four channels image.content['/Decode'] = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0] - text = ("q\n%f 0 0 %f 0 0 cm\n/Im0 Do\nQ"%(pdf_x, pdf_y)).encode('utf8') + text = ("q\n%0.4f 0 0 %0.4f 0 0 cm\n/Im0 Do\nQ"%(pdf_x, pdf_y)).encode('utf8') content = obj({ "/Length": len(text)