Add vector-only PDF test case

This commit is contained in:
James R. Barlow 2018-02-08 00:15:12 -08:00
parent fa2c0296d6
commit a9da839c39
3 changed files with 20 additions and 1 deletions

View File

@ -100,6 +100,9 @@ under the terms of the license in LICENSE.rst.
* - trivial.pdf
- @jbarlow83
- smallest possible valid PDF-1.3 with all required fields
* - vector.pdf
- @Catscratch
- a PDF with vector art and text rendered as curves with no fonts
Assemblies

BIN
tests/resources/vector.pdf Normal file

Binary file not shown.

View File

@ -1081,4 +1081,20 @@ def test_decompression_bomb(resources, outpdf):
outpdf,
'--max-image-mpixels', '2000'
)
assert p.returncode == 0
assert p.returncode == 0
def test_text_curves(spoof_tesseract_noop, resources, outpdf):
check_ocrmypdf(
resources / 'vector.pdf', outpdf, env=spoof_tesseract_noop)
info = PdfInfo(outpdf)
assert len(info.pages[0].images) == 0, "added images to the vector PDF"
check_ocrmypdf(
resources / 'vector.pdf', outpdf, '--force-ocr',
env=spoof_tesseract_noop)
info = PdfInfo(outpdf)
assert len(info.pages[0].images) != 0, "force did not rasterize"