diff options
Diffstat (limited to 'qpdf')
-rw-r--r-- | qpdf/qpdf.testcov | 4 | ||||
-rw-r--r-- | qpdf/qtest/qpdf.test | 13 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/stream-line-enders.out | 3 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/stream-line-enders.pdf | 50 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/stream-line-enders.qdf | 137 |
5 files changed, 206 insertions, 1 deletions
diff --git a/qpdf/qpdf.testcov b/qpdf/qpdf.testcov index 51a6f0e8..4e7e292a 100644 --- a/qpdf/qpdf.testcov +++ b/qpdf/qpdf.testcov @@ -188,3 +188,7 @@ QPDF_Stream getStreamData 0 QPDF_Stream expand filter abbreviation 0 qpdf-c called qpdf_read_memory 0 Pl_QPDFTokenizer found EI 0 +QPDF stream without newline 0 +QPDF stream with CR only 0 +QPDF stream with CRNL 0 +QPDF stream with NL only 0 diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index 62eed000..75a92aa4 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -111,7 +111,7 @@ $td->runtest("new stream", show_ntests(); # ---------- $td->notify("--- Miscellaneous Tests ---"); -$n_tests += 29; +$n_tests += 31; $td->runtest("qpdf version", {$td->COMMAND => "qpdf --version"}, @@ -265,6 +265,17 @@ $td->runtest("error/output redirection to strings", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); +$td->runtest("odd terminators for stream keyword", + {$td->COMMAND => + "qpdf --qdf --static-id" . + " stream-line-enders.pdf a.qdf"}, + {$td->FILE => "stream-line-enders.out", + $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); +$td->runtest("check output", + {$td->FILE => "a.qdf"}, + {$td->FILE => "stream-line-enders.qdf"}); + show_ntests(); # ---------- $td->notify("--- Error Condition Tests ---"); diff --git a/qpdf/qtest/qpdf/stream-line-enders.out b/qpdf/qtest/qpdf/stream-line-enders.out new file mode 100644 index 00000000..b7a7513c --- /dev/null +++ b/qpdf/qtest/qpdf/stream-line-enders.out @@ -0,0 +1,3 @@ +WARNING: stream-line-enders.pdf (object 5 0, file position 378): stream keyword followed by carriage return only +WARNING: stream-line-enders.pdf (object 6 0, file position 437): stream keyword not followed by proper line terminator +qpdf: operation succeeded with warnings; resulting file may have some problems diff --git a/qpdf/qtest/qpdf/stream-line-enders.pdf b/qpdf/qtest/qpdf/stream-line-enders.pdf new file mode 100644 index 00000000..e6238889 --- /dev/null +++ b/qpdf/qtest/qpdf/stream-line-enders.pdf @@ -0,0 +1,50 @@ +%PDF-1.3 +%¿÷¢þ +1 0 obj +<< /Pages 2 0 R /Type /Catalog >> +endobj +2 0 obj +<< /Count 1 /Kids [ 3 0 R ] /Type /Pages >> +endobj +3 0 obj +<< /Contents [ 4 0 R 5 0 R 6 0 R ] /MediaBox [ 0 0 612 792 ] /Parent 2 0 R /Resources << /Font << /F1 7 0 R >> /ProcSet 8 0 R >> /Type /Page >> +endobj +4 0 obj +<< /Length 14 >> +stream
+BT + /F1 24 Tf +endstream +endobj +5 0 obj +<< /Length 10 >> +stream
72 720 Td +endstream +endobj +6 0 obj +<< /Length 15 >> +stream (Potato) Tj +ET +endstream +endobj +7 0 obj +<< /BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font >> +endobj +8 0 obj +[ /PDF /Text ] +endobj +xref +0 9 +0000000000 65535 f +0000000015 00000 n +0000000064 00000 n +0000000123 00000 n +0000000282 00000 n +0000000346 00000 n +0000000405 00000 n +0000000469 00000 n +0000000576 00000 n +trailer << /Root 1 0 R /Size 9 /ID [<08aa98c73f8a7262d77c8328772c3989><7b1f32865e2165debe277f27ee790092>] >> +startxref +606 +%%EOF diff --git a/qpdf/qtest/qpdf/stream-line-enders.qdf b/qpdf/qtest/qpdf/stream-line-enders.qdf new file mode 100644 index 00000000..33536028 --- /dev/null +++ b/qpdf/qtest/qpdf/stream-line-enders.qdf @@ -0,0 +1,137 @@ +%PDF-1.3 +%¿÷¢þ +%QDF-1.0 + +%% Original object ID: 1 0 +1 0 obj +<< + /Pages 2 0 R + /Type /Catalog +>> +endobj + +%% Original object ID: 2 0 +2 0 obj +<< + /Count 1 + /Kids [ + 3 0 R + ] + /Type /Pages +>> +endobj + +%% Page 1 +%% Original object ID: 3 0 +3 0 obj +<< + /Contents [ + 4 0 R + 6 0 R + 8 0 R + ] + /MediaBox [ + 0 + 0 + 612 + 792 + ] + /Parent 2 0 R + /Resources << + /Font << + /F1 10 0 R + >> + /ProcSet 11 0 R + >> + /Type /Page +>> +endobj + +%% Contents for page 1 +%% Original object ID: 4 0 +4 0 obj +<< + /Length 5 0 R +>> +stream +BT + /F1 24 Tf +endstream +endobj + +5 0 obj +14 +endobj + +%% Contents for page 1 +%% Original object ID: 5 0 +6 0 obj +<< + /Length 7 0 R +>> +stream +72 720 Td +endstream +endobj + +7 0 obj +10 +endobj + +%% Contents for page 1 +%% Original object ID: 6 0 +8 0 obj +<< + /Length 9 0 R +>> +stream +(Potato) Tj +ET +endstream +endobj + +9 0 obj +15 +endobj + +%% Original object ID: 7 0 +10 0 obj +<< + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding + /Name /F1 + /Subtype /Type1 + /Type /Font +>> +endobj + +%% Original object ID: 8 0 +11 0 obj +[ + /PDF + /Text +] +endobj + +xref +0 12 +0000000000 65535 f +0000000052 00000 n +0000000133 00000 n +0000000242 00000 n +0000000516 00000 n +0000000585 00000 n +0000000654 00000 n +0000000719 00000 n +0000000788 00000 n +0000000858 00000 n +0000000904 00000 n +0000001050 00000 n +trailer << + /Root 1 0 R + /Size 12 + /ID [<08aa98c73f8a7262d77c8328772c3989><31415926535897932384626433832795>] +>> +startxref +1086 +%%EOF |