From ba2bae4accae4fa1f58bee82190fb7575aceaf72 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 29 Jul 2017 09:24:43 -0400 Subject: [PATCH] Use 1.2 as the version if we can't read it from the header The code was using 1.0, but we use /FlateDecode, which didn't appear until 1.2. --- libqpdf/QPDF.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index d82813d0..16641247 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -239,7 +239,9 @@ QPDF::parse(char const* password) QTC::TC("qpdf", "QPDF not a pdf file"); warn(QPDFExc(qpdf_e_damaged_pdf, this->file->getName(), "", 0, "can't find PDF header")); - this->pdf_version = "1.0"; + // QPDFWriter writes files that usually require at least + // version 1.2 for /FlateDecode + this->pdf_version = "1.2"; } if (atof(this->pdf_version.c_str()) < 1.2) {