Add test case for parsing endobj keywords.
authorTom Sepez <tsepez@chromium.org>
Wed, 15 Jul 2015 17:01:29 +0000 (10:01 -0700)
committerTom Sepez <tsepez@chromium.org>
Wed, 15 Jul 2015 17:01:29 +0000 (10:01 -0700)
There is no assurance that the expected result files are consistent
with other readers.  Jun will have to verify that after making his
parser changes for bug 493126.

BUG=493126
R=thestig@chromium.org, jun_fang@foxitsoftware.com

Review URL: https://codereview.chromium.org/1232803005 .

39 files changed:
testing/resources/pixel/endobj1.in [new file with mode: 0644]
testing/resources/pixel/endobj1.pdf [new file with mode: 0644]
testing/resources/pixel/endobj10.in [new file with mode: 0644]
testing/resources/pixel/endobj10.pdf [new file with mode: 0644]
testing/resources/pixel/endobj10_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj11.in [new file with mode: 0644]
testing/resources/pixel/endobj11.pdf [new file with mode: 0644]
testing/resources/pixel/endobj11_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj12.in [new file with mode: 0644]
testing/resources/pixel/endobj12.pdf [new file with mode: 0644]
testing/resources/pixel/endobj12_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj13.in [new file with mode: 0644]
testing/resources/pixel/endobj13.pdf [new file with mode: 0644]
testing/resources/pixel/endobj13_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj1_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj2.in [new file with mode: 0644]
testing/resources/pixel/endobj2.pdf [new file with mode: 0644]
testing/resources/pixel/endobj2_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj3.in [new file with mode: 0644]
testing/resources/pixel/endobj3.pdf [new file with mode: 0644]
testing/resources/pixel/endobj3_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj4.in [new file with mode: 0644]
testing/resources/pixel/endobj4.pdf [new file with mode: 0644]
testing/resources/pixel/endobj4_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj5.in [new file with mode: 0644]
testing/resources/pixel/endobj5.pdf [new file with mode: 0644]
testing/resources/pixel/endobj5_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj6.in [new file with mode: 0644]
testing/resources/pixel/endobj6.pdf [new file with mode: 0644]
testing/resources/pixel/endobj6_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj7.in [new file with mode: 0644]
testing/resources/pixel/endobj7.pdf [new file with mode: 0644]
testing/resources/pixel/endobj7_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj8.in [new file with mode: 0644]
testing/resources/pixel/endobj8.pdf [new file with mode: 0644]
testing/resources/pixel/endobj8_expected.pdf.0.png [new file with mode: 0644]
testing/resources/pixel/endobj9.in [new file with mode: 0644]
testing/resources/pixel/endobj9.pdf [new file with mode: 0644]
testing/resources/pixel/endobj9_expected.pdf.0.png [new file with mode: 0644]

diff --git a/testing/resources/pixel/endobj1.in b/testing/resources/pixel/endobj1.in
new file mode 100644 (file)
index 0000000..3e7f5e6
--- /dev/null
@@ -0,0 +1,60 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 1:
+%   /Length identifies intended end of stream, despite embedded keywords.
+%   Both should render as text.
+{{object 6 0}} <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj1.pdf b/testing/resources/pixel/endobj1.pdf
new file mode 100644 (file)
index 0000000..918e0a6
--- /dev/null
@@ -0,0 +1,70 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 1:
+%   /Length identifies intended end of stream, despite embedded keywords.
+%   Both should render as text.
+6 0 obj <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000566 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+715
+%%EOF
diff --git a/testing/resources/pixel/endobj10.in b/testing/resources/pixel/endobj10.in
new file mode 100644 (file)
index 0000000..d89132a
--- /dev/null
@@ -0,0 +1,59 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 10:
+%   /Length identifies end of stream, and embedded endstream/endobj
+%   keyword to trip us up, but missing endstream keyword.
+{{object 6 0}} <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endstream is not text) Tj
+0 50 Td
+/F2 13 Tf
+(endobj is not text) Tj
+ET
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj10.pdf b/testing/resources/pixel/endobj10.pdf
new file mode 100644 (file)
index 0000000..7d3f252
--- /dev/null
@@ -0,0 +1,69 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 10:
+%   /Length identifies end of stream, and embedded endstream/endobj
+%   keyword to trip us up, but missing endstream keyword.
+6 0 obj <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endstream is not text) Tj
+0 50 Td
+/F2 13 Tf
+(endobj is not text) Tj
+ET
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000587 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+722
+%%EOF
diff --git a/testing/resources/pixel/endobj10_expected.pdf.0.png b/testing/resources/pixel/endobj10_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj10_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj11.in b/testing/resources/pixel/endobj11.in
new file mode 100644 (file)
index 0000000..6bccbe5
--- /dev/null
@@ -0,0 +1,65 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 11:
+%   /Length points past intended end of stream, with embedded keywords.
+%   Both should render as text.
+{{object 6 0}} <<
+  /Length 128
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+
+% blah blah blah.
+% blah blah blah.
+% blah blah blah.
+
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj11.pdf b/testing/resources/pixel/endobj11.pdf
new file mode 100644 (file)
index 0000000..e72cff8
--- /dev/null
@@ -0,0 +1,75 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 11:
+%   /Length points past intended end of stream, with embedded keywords.
+%   Both should render as text.
+6 0 obj <<
+  /Length 128
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+
+% blah blah blah.
+% blah blah blah.
+% blah blah blah.
+
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000565 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+771
+%%EOF
diff --git a/testing/resources/pixel/endobj11_expected.pdf.0.png b/testing/resources/pixel/endobj11_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj11_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj12.in b/testing/resources/pixel/endobj12.in
new file mode 100644 (file)
index 0000000..1a89b31
--- /dev/null
@@ -0,0 +1,65 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 11:
+%   /Length points well past intended end of stream, with embedded keywords.
+%   Both should render as text.
+{{object 6 0}} <<
+  /Length 210
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+
+% blah blah blah.
+% blah blah blah.
+% blah blah blah.
+
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj12.pdf b/testing/resources/pixel/endobj12.pdf
new file mode 100644 (file)
index 0000000..3d07ab5
--- /dev/null
@@ -0,0 +1,75 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 11:
+%   /Length points well past intended end of stream, with embedded keywords.
+%   Both should render as text.
+6 0 obj <<
+  /Length 210
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+
+% blah blah blah.
+% blah blah blah.
+% blah blah blah.
+
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000570 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+776
+%%EOF
diff --git a/testing/resources/pixel/endobj12_expected.pdf.0.png b/testing/resources/pixel/endobj12_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj12_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj13.in b/testing/resources/pixel/endobj13.in
new file mode 100644 (file)
index 0000000..81623a2
--- /dev/null
@@ -0,0 +1,65 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 11:
+%   /Length points well past EOF, with embedded keywords.
+%   Both should render as text.
+{{object 6 0}} <<
+  /Length 1000
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+
+% blah blah blah.
+% blah blah blah.
+% blah blah blah.
+
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj13.pdf b/testing/resources/pixel/endobj13.pdf
new file mode 100644 (file)
index 0000000..8193e53
--- /dev/null
@@ -0,0 +1,75 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 11:
+%   /Length points well past EOF, with embedded keywords.
+%   Both should render as text.
+6 0 obj <<
+  /Length 1000
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+
+% blah blah blah.
+% blah blah blah.
+% blah blah blah.
+
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000551 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+758
+%%EOF
diff --git a/testing/resources/pixel/endobj13_expected.pdf.0.png b/testing/resources/pixel/endobj13_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj13_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj1_expected.pdf.0.png b/testing/resources/pixel/endobj1_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..a044bb0
Binary files /dev/null and b/testing/resources/pixel/endobj1_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj2.in b/testing/resources/pixel/endobj2.in
new file mode 100644 (file)
index 0000000..341fe7e
--- /dev/null
@@ -0,0 +1,59 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 4:
+%   /Length identifies intended end of stream, but whitespace rather than
+%   newline following the stream keyword.
+{{object 6 0}} <<
+  /Length 97
+>>
+stream BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj2.pdf b/testing/resources/pixel/endobj2.pdf
new file mode 100644 (file)
index 0000000..6c5982a
--- /dev/null
@@ -0,0 +1,69 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 4:
+%   /Length identifies intended end of stream, but whitespace rather than
+%   newline following the stream keyword.
+6 0 obj <<
+  /Length 97
+>>
+stream BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000576 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+725
+%%EOF
diff --git a/testing/resources/pixel/endobj2_expected.pdf.0.png b/testing/resources/pixel/endobj2_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj2_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj3.in b/testing/resources/pixel/endobj3.in
new file mode 100644 (file)
index 0000000..11f5a99
--- /dev/null
@@ -0,0 +1,59 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 3:
+%   /Length identifies intended end of stream, but whitespace rather than
+%   newline following the endstream keyword.
+{{object 6 0}} <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj3.pdf b/testing/resources/pixel/endobj3.pdf
new file mode 100644 (file)
index 0000000..65f3b13
--- /dev/null
@@ -0,0 +1,69 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 3:
+%   /Length identifies intended end of stream, but whitespace rather than
+%   newline following the endstream keyword.
+6 0 obj <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000579 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+728
+%%EOF
diff --git a/testing/resources/pixel/endobj3_expected.pdf.0.png b/testing/resources/pixel/endobj3_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..a044bb0
Binary files /dev/null and b/testing/resources/pixel/endobj3_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj4.in b/testing/resources/pixel/endobj4.in
new file mode 100644 (file)
index 0000000..a49a5c2
--- /dev/null
@@ -0,0 +1,59 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 5:
+%   /Length identifies intended end of stream, but whitespace rather than
+%   newline following the endobj keyword.
+{{object 6 0}} <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+endobj {{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj4.pdf b/testing/resources/pixel/endobj4.pdf
new file mode 100644 (file)
index 0000000..3758492
--- /dev/null
@@ -0,0 +1,69 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 5:
+%   /Length identifies intended end of stream, but whitespace rather than
+%   newline following the endobj keyword.
+6 0 obj <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endstream
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000576 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+718
+%%EOF
diff --git a/testing/resources/pixel/endobj4_expected.pdf.0.png b/testing/resources/pixel/endobj4_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..a044bb0
Binary files /dev/null and b/testing/resources/pixel/endobj4_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj5.in b/testing/resources/pixel/endobj5.in
new file mode 100644 (file)
index 0000000..dce8795
--- /dev/null
@@ -0,0 +1,60 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 5:
+%   /Length incorrectly identifies middle of stream, no confusing
+%   keywords to trip us up.
+{{object 6 0}} <<
+  /Length 50
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(xxxxxx is text) Tj
+0 50 Td
+/F2 13 Tf
+(yyyyyyyyy after bad /Length) Tj
+ET
+endstream
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj5.pdf b/testing/resources/pixel/endobj5.pdf
new file mode 100644 (file)
index 0000000..02c99f3
--- /dev/null
@@ -0,0 +1,70 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 5:
+%   /Length incorrectly identifies middle of stream, no confusing
+%   keywords to trip us up.
+6 0 obj <<
+  /Length 50
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(xxxxxx is text) Tj
+0 50 Td
+/F2 13 Tf
+(yyyyyyyyy after bad /Length) Tj
+ET
+endstream
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000554 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+701
+%%EOF
diff --git a/testing/resources/pixel/endobj5_expected.pdf.0.png b/testing/resources/pixel/endobj5_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..87f2a9b
Binary files /dev/null and b/testing/resources/pixel/endobj5_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj6.in b/testing/resources/pixel/endobj6.in
new file mode 100644 (file)
index 0000000..53f546f
--- /dev/null
@@ -0,0 +1,60 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 6:
+%   /Length incorrectly identifies middle of stream, and confusing
+%   keywords to trip us up.  Should only render |endobj| as text.
+{{object 6 0}} <<
+  /Length 50
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream after bad /Length) Tj
+ET
+endstream
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj6.pdf b/testing/resources/pixel/endobj6.pdf
new file mode 100644 (file)
index 0000000..1e0006e
--- /dev/null
@@ -0,0 +1,70 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 6:
+%   /Length incorrectly identifies middle of stream, and confusing
+%   keywords to trip us up.  Should only render |endobj| as text.
+6 0 obj <<
+  /Length 50
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream after bad /Length) Tj
+ET
+endstream
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000593 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+740
+%%EOF
diff --git a/testing/resources/pixel/endobj6_expected.pdf.0.png b/testing/resources/pixel/endobj6_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj6_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj7.in b/testing/resources/pixel/endobj7.in
new file mode 100644 (file)
index 0000000..747514f
--- /dev/null
@@ -0,0 +1,60 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 7:
+%   /Length identifies intended end of stream, but endstream/endobj
+%   keywords swapped. Should render |endobj| and |endstream| as text.
+{{object 6 0}} <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endobj
+endstream
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj7.pdf b/testing/resources/pixel/endobj7.pdf
new file mode 100644 (file)
index 0000000..787b61a
--- /dev/null
@@ -0,0 +1,70 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 7:
+%   /Length identifies intended end of stream, but endstream/endobj
+%   keywords swapped. Should render |endobj| and |endstream| as text.
+6 0 obj <<
+  /Length 97
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is text per /Length) Tj
+ET
+endobj
+endstream
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000598 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+747
+%%EOF
diff --git a/testing/resources/pixel/endobj7_expected.pdf.0.png b/testing/resources/pixel/endobj7_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj7_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj8.in b/testing/resources/pixel/endobj8.in
new file mode 100644 (file)
index 0000000..66892e2
--- /dev/null
@@ -0,0 +1,59 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 8:
+%   No /Length to identify end of stream, but embedded endobj/endstream
+%   keywords to trip us up.  Should only render |endobj| as text.
+{{object 6 0}} <<
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is not text) Tj
+ET
+endstream
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj8.pdf b/testing/resources/pixel/endobj8.pdf
new file mode 100644 (file)
index 0000000..26f70ad
--- /dev/null
@@ -0,0 +1,69 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 8:
+%   No /Length to identify end of stream, but embedded endobj/endstream
+%   keywords to trip us up.  Should only render |endobj| as text.
+6 0 obj <<
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endobj is text) Tj
+0 50 Td
+/F2 13 Tf
+(endstream is not text) Tj
+ET
+endstream
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000598 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+726
+%%EOF
diff --git a/testing/resources/pixel/endobj8_expected.pdf.0.png b/testing/resources/pixel/endobj8_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj8_expected.pdf.0.png differ
diff --git a/testing/resources/pixel/endobj9.in b/testing/resources/pixel/endobj9.in
new file mode 100644 (file)
index 0000000..fb156fa
--- /dev/null
@@ -0,0 +1,59 @@
+{{header}}
+{{object 1 0}} <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+{{object 2 0}} <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+{{object 3 0}} <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+{{object 4 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+{{object 5 0}} <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 9:
+%   No /Length to identify end of stream, but embedded endstream/endobj
+%   keyword to trip us up.  Should render nothing as text.
+{{object 6 0}} <<
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endstream is not text) Tj
+0 50 Td
+/F2 13 Tf
+(endobj is not text) Tj
+ET
+endstream
+endobj
+{{xref}}
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/endobj9.pdf b/testing/resources/pixel/endobj9.pdf
new file mode 100644 (file)
index 0000000..b085956
--- /dev/null
@@ -0,0 +1,69 @@
+%PDF-1.7
+% ò¤ô
+1 0 obj <<
+  /Type /Catalog
+  /Pages 2 0 R
+>>
+2 0 obj <<
+  /Type /Pages
+  /MediaBox [ 0 0 200 200 ]
+  /Count 1
+  /Kids [ 3 0 R ]
+>>
+endobj
+3 0 obj <<
+  /Type /Page
+  /Parent 2 0 R
+  /Resources <<
+    /Font <<
+      /F1 4 0 R
+      /F2 5 0 R
+    >>
+  >>
+  /Contents 6 0 R
+>>
+endobj
+4 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Times-Roman
+>>
+endobj
+5 0 obj <<
+  /Type /Font
+  /Subtype /Type1
+  /BaseFont /Helvetica
+>>
+endobj
+% Case 9:
+%   No /Length to identify end of stream, but embedded endstream/endobj
+%   keyword to trip us up.  Should render nothing as text.
+6 0 obj <<
+>>
+stream
+BT
+20 50 Td
+/F1 12 Tf
+(endstream is not text) Tj
+0 50 Td
+/F2 13 Tf
+(endobj is not text) Tj
+ET
+endstream
+endobj
+xref
+0 7
+0000000000 65535 f 
+0000000015 00000 n 
+0000000061 00000 n 
+0000000154 00000 n 
+0000000296 00000 n 
+0000000374 00000 n 
+0000000591 00000 n 
+trailer <<
+  /Size 6
+  /Root 1 0 R
+>>
+startxref
+723
+%%EOF
diff --git a/testing/resources/pixel/endobj9_expected.pdf.0.png b/testing/resources/pixel/endobj9_expected.pdf.0.png
new file mode 100644 (file)
index 0000000..3edcc2d
Binary files /dev/null and b/testing/resources/pixel/endobj9_expected.pdf.0.png differ