Handle indirect Xobjects

This commit is contained in:
Peter Williams 2017-04-06 11:59:32 +10:00
parent a1d15f3838
commit ff7dbe17e9

View File

@ -767,6 +767,8 @@ type PdfPageResourcesColorspaces struct {
container *PdfIndirectObject container *PdfIndirectObject
} }
func newPdfPageResourcesColorspacesFromPdfObject(obj PdfObject) (*PdfPageResourcesColorspaces, error) { func newPdfPageResourcesColorspacesFromPdfObject(obj PdfObject) (*PdfPageResourcesColorspaces, error) {
colorspaces := &PdfPageResourcesColorspaces{} colorspaces := &PdfPageResourcesColorspaces{}
@ -913,7 +915,9 @@ func (r *PdfPageResources) GetXObjectByName(keyName string) (*PdfObjectStream, X
return nil, XObjectTypeUndefined return nil, XObjectTypeUndefined
} }
xresDict, has := r.XObject.(*PdfObjectDictionary) xobj := TraceToDirectObject(r.XObject)
xresDict, has := xobj.(*PdfObjectDictionary)
if !has { if !has {
return nil, XObjectTypeUndefined return nil, XObjectTypeUndefined
} }