Skip to content

Commit

Permalink
Merge pull request py-pdf#66 from Rob1080/master
Browse files Browse the repository at this point in the history
Fix for when type isn't present in pages dictionary
  • Loading branch information
mstamy2 committed Feb 3, 2014
2 parents 03642f5 + 101d917 commit b92eef2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PyPDF2/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,11 @@ def _flatten(self, pages=None, inherit=None, indirectRef=None):
self.flattenedPages = []
catalog = self.trailer["/Root"].getObject()
pages = catalog["/Pages"].getObject()
t = pages["/Type"]

t = "/Pages"
if "/Type" in pages:
t = pages["/Type"]

if t == "/Pages":
for attr in inheritablePageAttributes:
if attr in pages:
Expand Down

0 comments on commit b92eef2

Please sign in to comment.