mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2025-12-29 16:10:06 +00:00
Change pdf.root to pdf.Root
This commit is contained in:
parent
ced7ad9164
commit
3707af3b74
@ -818,12 +818,12 @@ class PdfInfo:
|
||||
check_pages=check_pages,
|
||||
detailed_analysis=detailed_analysis,
|
||||
)
|
||||
self._needs_rendering = pdf.root.get('/NeedsRendering', False)
|
||||
self._needs_rendering = pdf.Root.get('/NeedsRendering', False)
|
||||
self._has_acroform = False
|
||||
if '/AcroForm' in pdf.root:
|
||||
if len(pdf.root.AcroForm.get('/Fields', [])) > 0:
|
||||
if '/AcroForm' in pdf.Root:
|
||||
if len(pdf.Root.AcroForm.get('/Fields', [])) > 0:
|
||||
self._has_acroform = True
|
||||
elif '/XFA' in pdf.root.AcroForm:
|
||||
elif '/XFA' in pdf.Root.AcroForm:
|
||||
self._has_acroform = True
|
||||
|
||||
@property
|
||||
|
||||
@ -302,8 +302,8 @@ def test_kodak_toc(resources, outpdf):
|
||||
|
||||
p = pikepdf.open(outpdf)
|
||||
|
||||
if pikepdf.Name.First in p.root.Outlines:
|
||||
assert isinstance(p.root.Outlines.First, pikepdf.Dictionary)
|
||||
if pikepdf.Name.First in p.Root.Outlines:
|
||||
assert isinstance(p.Root.Outlines.First, pikepdf.Dictionary)
|
||||
|
||||
|
||||
def test_metadata_fixup_warning(resources, outdir, caplog):
|
||||
|
||||
@ -137,9 +137,9 @@ def test_report_file_size(tmp_path, caplog):
|
||||
caplog.clear()
|
||||
|
||||
waste_of_space = b'Dummy' * 5000
|
||||
pdf.root.Dummy = waste_of_space
|
||||
pdf.Root.Dummy = waste_of_space
|
||||
pdf.save(in_)
|
||||
pdf.root.Dummy2 = waste_of_space + waste_of_space
|
||||
pdf.Root.Dummy2 = waste_of_space + waste_of_space
|
||||
pdf.save(out)
|
||||
|
||||
with patch('ocrmypdf._validation.jbig2enc.available', return_value=True), patch(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user