2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-31 17:30:54 +00:00

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.
This commit is contained in:
Jay Berkenbilt 2017-07-29 09:24:43 -04:00
parent bd72ec98ef
commit ba2bae4acc

View File

@ -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)
{