diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore
index ac994ea7c..69425f066 100644
--- a/test/pdfs/.gitignore
+++ b/test/pdfs/.gitignore
@@ -66,6 +66,7 @@
 !issue5070.pdf
 !issue5238.pdf
 !issue5244.pdf
+!issue5291.pdf
 !issue5421.pdf
 !gradientfill.pdf
 !bug903856.pdf
diff --git a/test/pdfs/issue5291.pdf b/test/pdfs/issue5291.pdf
new file mode 100644
index 000000000..a206a91d1
--- /dev/null
+++ b/test/pdfs/issue5291.pdf
@@ -0,0 +1,71 @@
+%PDF-1.7
+16 0 obj
+<<
+/Type /Catalog
+/Pages 17 0 R
+>>
+endobj
+17 0 obj
+<<
+/Type /Pages
+/MediaBox [ 0 0 200 50 ]
+/Count 1
+/Kids [ 18 0 R ]
+>>
+endobj
+18 0 obj
+<<
+/Type /Page
+/Parent 17 0 R
+/Resources <<
+/Font <<
+/F1 19 0 R
+>>
+
+>>
+
+/Contents 20 0 R
+>>
+endobj
+19 0 obj
+<<
+/Type /Font
+/BaseFont /Helvetica
+/Subtype /Type1
+/Encoding /WinAnsiEncoding
+>>
+endobj
+20 0 obj
+<<
+/Length 115
+>>
+stream
+0.000283465 0 0 0.000283465 0 0 cm
+BT
+/F1 56234 Tf
+1.000000 0 0.000000 1.000000 25000 75000 Tm 
+(Issue 5291) Tj
+ET
+endstream
+endobj
+xref
+0 1
+0000000000 65535 f
+16 1
+0000000009 00000 n
+17 1
+0000000060 00000 n
+18 1
+0000000146 00000 n
+19 1
+0000000254 00000 n
+20 1
+0000000352 00000 n
+trailer
+<<
+/Size 5
+/Root 16 0 R
+>>
+startxref
+518
+%%EOF
\ No newline at end of file
diff --git a/test/test_manifest.json b/test/test_manifest.json
index 25746cd9b..d24a6a5ab 100644
--- a/test/test_manifest.json
+++ b/test/test_manifest.json
@@ -934,6 +934,13 @@
        "rounds": 1,
        "type": "eq"
     },
+    {  "id": "issue5291",
+       "file": "pdfs/issue5291.pdf",
+       "md5": "edae085495c702069ffdbf785a826556",
+       "link": false,
+       "rounds": 1,
+       "type": "eq"
+    },
     {  "id": "issue5244",
        "file": "pdfs/issue5244.pdf",
        "md5": "a50cd364c3976c744627b4b9bb90c761",