aboutsummaryrefslogtreecommitdiffstats
path: root/examples/qtest
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-02-11 21:41:02 +0100
committerJay Berkenbilt <ejb@ql.org>2018-02-19 03:05:47 +0100
commit5708b5d0aa9c94ab663509fbb865aa27a134aeb3 (patch)
tree30a85d51d3d720dfca0a09b9dba4eef0c3fe2bec /examples/qtest
parentfd02944e1953931e07f124448350db91038020af (diff)
downloadqpdf-5708b5d0aa9c94ab663509fbb865aa27a134aeb3.tar.zst
Add additional interface for filtering page contents
Diffstat (limited to 'examples/qtest')
-rw-r--r--examples/qtest/count-strings.test17
-rw-r--r--examples/qtest/count-strings/in.pdfbin0 -> 1348 bytes
-rw-r--r--examples/qtest/count-strings/out16
3 files changed, 33 insertions, 0 deletions
diff --git a/examples/qtest/count-strings.test b/examples/qtest/count-strings.test
new file mode 100644
index 00000000..ba3f835b
--- /dev/null
+++ b/examples/qtest/count-strings.test
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+require 5.008;
+BEGIN { $^W = 1; }
+use strict;
+
+chdir("count-strings");
+
+require TestDriver;
+
+my $td = new TestDriver('pdf-count-strings');
+
+$td->runtest("filter tokens",
+ {$td->COMMAND => "pdf-count-strings in.pdf"},
+ {$td->FILE => "out", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+
+$td->report(1);
diff --git a/examples/qtest/count-strings/in.pdf b/examples/qtest/count-strings/in.pdf
new file mode 100644
index 00000000..591614c4
--- /dev/null
+++ b/examples/qtest/count-strings/in.pdf
Binary files differ
diff --git a/examples/qtest/count-strings/out b/examples/qtest/count-strings/out
new file mode 100644
index 00000000..87b024fc
--- /dev/null
+++ b/examples/qtest/count-strings/out
@@ -0,0 +1,16 @@
+Page 1: strings = 3
+% Contents of page 2
+BT
+ /F1 24 Tf
+ 72 720 Td
+ (Four ) Tj
+ (Five ) Tj
+ (Six )
+ (beautiful ) Tj
+ (strings) Tj
+ (!) Tj
+ET
+
+% strings found: 6
+% end 2
+Page 2: strings = 6