From 29194cd55a189274ee0de4c625adbe1a71b99293 Mon Sep 17 00:00:00 2001 From: clach04 Date: Fri, 15 Apr 2022 04:14:41 -0700 Subject: [PATCH] ROBUST: title sometimes None (#744) Closes #511 --- PyPDF2/pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyPDF2/pdf.py b/PyPDF2/pdf.py index 9bfa1bd0d..5bd4b7968 100644 --- a/PyPDF2/pdf.py +++ b/PyPDF2/pdf.py @@ -2896,7 +2896,7 @@ def getText(self, key): return retval return None - title = property(lambda self: self.getText("/Title")) + title = property(lambda self: self.getText("/Title") or self.get("/Title").getObject() if self.get("/Title") else None) """Read-only property accessing the document's **title**. Returns a unicode string (``TextStringObject``) or ``None`` if the title is not specified."""