diff options
-rw-r--r-- | libqpdf/QPDFJob.cc | 14 | ||||
-rw-r--r-- | qpdf/qtest/page-errors.test | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/page-missing-mediabox.out | 1 |
3 files changed, 12 insertions, 5 deletions
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index bb17ae84..5296b7b3 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -477,6 +477,12 @@ QPDFJob::createQPDF() } handleUnderOverlay(pdf); handleTransformations(pdf); + + for (auto& foreign: page_heap) { + if (foreign->anyWarnings()) { + m->warnings = true; + } + } return pdf_sp; } @@ -1269,9 +1275,9 @@ QPDFJob::doJSONEncrypt(Pipeline* p, bool& first, QPDF& pdf) } j_parameters.addDictionaryMember("bits", JSON::makeInt(bits)); j_parameters.addDictionaryMember("key", key); - auto fix_method = [is_encrypted](QPDF::encryption_method_e& m) { - if (is_encrypted && m == QPDF::e_none) { - m = QPDF::e_rc4; + auto fix_method = [is_encrypted](QPDF::encryption_method_e& method) { + if (is_encrypted && method == QPDF::e_none) { + method = QPDF::e_rc4; } }; fix_method(stream_method); @@ -2342,7 +2348,7 @@ QPDFJob::handlePageSpecs(QPDF& pdf, std::vector<std::unique_ptr<QPDF>>& page_hea // paths to refer to the same file is a documented workaround for duplicating a page. If // you are using this an example of how to do this with the API, you can just create two // different QPDF objects to the same underlying file with the same path to achieve the - // same affect. + // same effect. char const* password = page_spec.password.get(); if ((!m->encryption_file.empty()) && (password == nullptr) && (page_spec.filename == m->encryption_file)) { diff --git a/qpdf/qtest/page-errors.test b/qpdf/qtest/page-errors.test index 60894f96..3f14f24e 100644 --- a/qpdf/qtest/page-errors.test +++ b/qpdf/qtest/page-errors.test @@ -22,7 +22,7 @@ $td->runtest("handle page no with contents", $td->NORMALIZE_NEWLINES); $td->runtest("handle page with missing MediaBox", {$td->COMMAND => "qpdf --static-id --empty --pages page-no-content.pdf -- out.pdf"}, - {$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 0}, + {$td->FILE => "page-missing-mediabox.out", $td->EXIT_STATUS => 3}, $td->NORMALIZE_NEWLINES); $td->runtest("check output", {$td->FILE => "out.pdf"}, diff --git a/qpdf/qtest/qpdf/page-missing-mediabox.out b/qpdf/qtest/qpdf/page-missing-mediabox.out index 9db62ed6..91e85707 100644 --- a/qpdf/qtest/qpdf/page-missing-mediabox.out +++ b/qpdf/qtest/qpdf/page-missing-mediabox.out @@ -1 +1,2 @@ WARNING: page-no-content.pdf, object 4 0 at offset 288: kid 1 (from 0) MediaBox is undefined; setting to letter / ANSI A +qpdf: operation succeeded with warnings; resulting file may have some problems |