From 96555047ea3b80d8fa89469e5e6623124050be16 Mon Sep 17 00:00:00 2001 From: Adrian Henry Date: Tue, 29 Oct 2019 19:03:30 +0000 Subject: [PATCH] convert boolean values to correct representation in PdfDicts --- pdfrw/pdfwriter.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pdfrw/pdfwriter.py b/pdfrw/pdfwriter.py index 3c887ba..d999ba5 100755 --- a/pdfrw/pdfwriter.py +++ b/pdfrw/pdfwriter.py @@ -107,6 +107,11 @@ def add(obj): def format_array(myarray, formatter): # Format array data into semi-readable ASCII if sum([len(x) for x in myarray]) <= 70: + if len(myarray) == 2: + if myarray[1] == 'True': + myarray[1] = 'true' + elif myarray[1] == 'False': + myarray[1] = 'false' return formatter % space_join(myarray) return format_big(myarray, formatter)