mirror of
https://github.com/unidoc/unipdf.git
synced 2025-04-27 13:48:51 +08:00
Only attempt to load annotation from a valid indirect object for annotation Popup entries. Fixes #91.
This commit is contained in:
parent
944d6dd371
commit
30ffbe3cbe
@ -938,18 +938,18 @@ func (r *PdfReader) newPdfAnnotationMarkupFromDict(d *PdfObjectDictionary) (*Pdf
|
||||
if _, isNull := obj.(*PdfObjectNull); !isNull {
|
||||
return nil, fmt.Errorf("Popup should point to an indirect object")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
popupAnnotObj, err := r.newPdfAnnotationFromIndirectObject(indObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
popupAnnot, isPopupAnnot := popupAnnotObj.context.(*PdfAnnotationPopup)
|
||||
if !isPopupAnnot {
|
||||
return nil, fmt.Errorf("Popup not referring to a popup annotation!")
|
||||
}
|
||||
|
||||
popupAnnotObj, err := r.newPdfAnnotationFromIndirectObject(indObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
annot.Popup = popupAnnot
|
||||
}
|
||||
popupAnnot, isPopupAnnot := popupAnnotObj.context.(*PdfAnnotationPopup)
|
||||
if !isPopupAnnot {
|
||||
return nil, fmt.Errorf("Popup not referring to a popup annotation!")
|
||||
}
|
||||
|
||||
annot.Popup = popupAnnot
|
||||
}
|
||||
|
||||
if obj := d.Get("CA"); obj != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user