From e1c918631a3c10f4efecd328b8cce7af1dc83c49 Mon Sep 17 00:00:00 2001 From: Adrian-George Bostan Date: Mon, 22 Apr 2019 22:43:55 +0300 Subject: [PATCH] Make T field optional on PDF field dictionary parse --- pdf/model/fields.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/pdf/model/fields.go b/pdf/model/fields.go index e48a5339..a4a18bf0 100644 --- a/pdf/model/fields.go +++ b/pdf/model/fields.go @@ -574,13 +574,8 @@ func (r *PdfReader) newPdfFieldFromIndirectObject(container *core.PdfIndirectObj // attributes for descendant terminal fields. Does not logically have a type of its own. // Terminal field: An actual field with a type. - // Partial field name (Required) - if s, has := d.Get("T").(*core.PdfObjectString); has { - field.T = s - } else { - common.Log.Debug("Invalid - T field missing (required)") - return nil, ErrTypeCheck - } + // Partial field name. + field.T, _ = d.Get("T").(*core.PdfObjectString) // Alternate description (Optional) field.TU, _ = d.Get("TU").(*core.PdfObjectString)