mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-11-02 02:40:44 +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
|
||||
- @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
BIN
tests/resources/vector.pdf
Normal file
Binary file not shown.
@ -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"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user