mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-11-15 17:44:46 +00:00
Add vector-only PDF test case
This commit is contained in:
parent
fa2c0296d6
commit
a9da839c39
@ -100,6 +100,9 @@ under the terms of the license in LICENSE.rst.
|
|||||||
* - trivial.pdf
|
* - trivial.pdf
|
||||||
- @jbarlow83
|
- @jbarlow83
|
||||||
- smallest possible valid PDF-1.3 with all required fields
|
- 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
|
Assemblies
|
||||||
|
|||||||
BIN
tests/resources/vector.pdf
Normal file
BIN
tests/resources/vector.pdf
Normal file
Binary file not shown.
@ -1082,3 +1082,19 @@ def test_decompression_bomb(resources, outpdf):
|
|||||||
'--max-image-mpixels', '2000'
|
'--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"
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user