diff options
Diffstat (limited to 'examples/qtest')
-rw-r--r-- | examples/qtest/linearize.test | 32 | ||||
-rw-r--r-- | examples/qtest/linearize/check.out | 5 | ||||
-rw-r--r-- | examples/qtest/linearize/input.pdf | 79 |
3 files changed, 116 insertions, 0 deletions
diff --git a/examples/qtest/linearize.test b/examples/qtest/linearize.test new file mode 100644 index 00000000..700cdca3 --- /dev/null +++ b/examples/qtest/linearize.test @@ -0,0 +1,32 @@ +#!/usr/bin/env perl +require 5.008; +BEGIN { $^W = 1; } +use strict; + +chdir("linearize") or die "chdir testdir failed: $!\n"; + +require TestDriver; + +cleanup(); + +my $td = new TestDriver('linearize'); + +my $qpdf = $ENV{'QPDF_BIN'} or die; + +$td->runtest("linearize", + {$td->COMMAND => "pdf-linearize input.pdf '' a.pdf"}, + {$td->STRING => "", $td->EXIT_STATUS => 0}); + +$td->runtest("check", + {$td->COMMAND => "$qpdf --check a.pdf"}, + {$td->FILE => "check.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + +cleanup(); + +$td->report(2); + +sub cleanup +{ + unlink "a.pdf"; +} diff --git a/examples/qtest/linearize/check.out b/examples/qtest/linearize/check.out new file mode 100644 index 00000000..c2063a41 --- /dev/null +++ b/examples/qtest/linearize/check.out @@ -0,0 +1,5 @@ +checking a.pdf +PDF Version: 1.3 +File is not encrypted +File is linearized +No errors found diff --git a/examples/qtest/linearize/input.pdf b/examples/qtest/linearize/input.pdf new file mode 100644 index 00000000..a7e01f91 --- /dev/null +++ b/examples/qtest/linearize/input.pdf @@ -0,0 +1,79 @@ +%PDF-1.3 +1 0 obj +<< + /Type /Catalog + /Pages 2 0 R +>> +endobj + +2 0 obj +<< + /Type /Pages + /Kids [ + 3 0 R + ] + /Count 1 +>> +endobj + +3 0 obj +<< + /Type /Page + /Parent 2 0 R + /MediaBox [0 0 612 792] + /Contents 4 0 R + /Resources << + /ProcSet 5 0 R + /Font << + /F1 6 0 R + >> + >> +>> +endobj + +4 0 obj +<< + /Length 44 +>> +stream +BT + /F1 24 Tf + 72 720 Td + (Potato) Tj +ET +endstream +endobj + +5 0 obj +[ + /PDF + /Text +] +endobj + +6 0 obj +<< + /Type /Font + /Subtype /Type1 + /Name /F1 + /BaseFont /Helvetica + /Encoding /WinAnsiEncoding +>> +endobj + +xref +0 7 +0000000000 65535 f +0000000009 00000 n +0000000063 00000 n +0000000135 00000 n +0000000307 00000 n +0000000403 00000 n +0000000438 00000 n +trailer << + /Size 7 + /Root 1 0 R +>> +startxref +556 +%%EOF |