mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-06-26 23:49:59 +00:00
Create test case for Form XObjects
This commit is contained in:
parent
5a817370fd
commit
d1a0065ef8
@ -356,9 +356,6 @@ def check_options(options, log):
|
||||
sys.exit(ExitCode.missing_dependency)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ----------
|
||||
# Logging
|
||||
|
||||
|
@ -64,6 +64,9 @@ under the terms of the license in LICENSE.rst.
|
||||
* - epson.pdf
|
||||
- @lowesjam
|
||||
- a linearized PDF containing some unusual indirect objects, created by an Epson printer; printout of a Wikipedia article (CC BY-SA)
|
||||
* - formxobject.pdf
|
||||
- @jbarlow83
|
||||
- hand-crafted exotic PDF containing an image inside a Form XObject
|
||||
* - francais.pdf
|
||||
- @jbarlow83
|
||||
- a page containing French accents (diacritics)
|
||||
|
BIN
tests/resources/formxobject.pdf
Normal file
BIN
tests/resources/formxobject.pdf
Normal file
Binary file not shown.
@ -742,3 +742,9 @@ THIS FILE IS INVALID
|
||||
'--tesseract-config', str(cfg_file))
|
||||
assert "parameter not found" in err, "No error message"
|
||||
assert p.returncode == ExitCode.invalid_config
|
||||
|
||||
|
||||
def test_form_xobject(spoof_tesseract_noop, resources, outpdf):
|
||||
check_ocrmypdf(resources / 'formxobject.pdf', outpdf,
|
||||
'--force-ocr',
|
||||
env=spoof_tesseract_noop)
|
||||
|
@ -101,3 +101,10 @@ def test_jpeg(resources, outdir):
|
||||
assert pdfimage['enc'] == 'jpeg'
|
||||
assert (pdfimage['dpi_w'] - 150) < 1e-5
|
||||
|
||||
|
||||
def test_form_xobject(resources):
|
||||
filename = resources / 'formxobject.pdf'
|
||||
|
||||
pdfinfo = pageinfo.pdf_get_all_pageinfo(str(filename))
|
||||
pdfimage = pdfinfo[0]['images'][0]
|
||||
assert pdfimage['width'] == 50
|
||||
|
Loading…
x
Reference in New Issue
Block a user