Skip to content

Pages without Resources dictionary #270

@jvalenzuela

Description

@jvalenzuela

Failure using mergePage() with pages that do not have a resource dictionary. This appears to be a valid condition, and the page should then inherit dictionary content from its parent. Trackback below:

Traceback (most recent call last):
  File "C:\Python27\lib\lib-tk\Tkinter.py", line 1536, in __call__
    return self.func(*args)
  File "pdfbind\view.py", line 153, in _on_execute_click
    b.bind()
  File "pdfbind\bind.py", line 176, in bind
    page_bufs.append(page_header.merge(p, header_info))
  File "pdfbind\header.py", line 68, in merge
    header_page.mergePage(orig_page)
  File "PyPDF2\pdf.py", line 2211, in mergePage
    self._mergePage(page2)
  File "PyPDF2\pdf.py", line 2221, in _mergePage
    page2Resources = page2["/Resources"].getObject()
  File "PyPDF2\generic.py", line 512, in __getitem__
    return dict.__getitem__(self, key).getObject()
KeyError: '/Resources'

Metadata

Metadata

Assignees

No one assigned

    Labels

    is-robustness-issueFrom a users perspective, this is about robustnessneeds-pdfThe issue needs a PDF file to show the problemneeds-testA test should be added before this PR is merged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions