mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-02 22:17:06 +08:00
Export trailer dict from reader
This commit is contained in:
parent
8b2146ea10
commit
e8c0a4be98
@ -530,7 +530,7 @@ func (this *PdfReader) buildPageList(node *PdfIndirectObject, parent *PdfIndirec
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if *objType != "Pages" {
|
if *objType != "Pages" {
|
||||||
common.Log.Trace("ERROR: Table of content containing non Page/Pages object! (%s)", objType)
|
common.Log.Debug("ERROR: Table of content containing non Page/Pages object! (%s)", objType)
|
||||||
return errors.New("Table of content containing non Page/Pages object!")
|
return errors.New("Table of content containing non Page/Pages object!")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -747,8 +747,17 @@ func (this *PdfReader) Inspect() (map[string]int, error) {
|
|||||||
return this.parser.Inspect()
|
return this.parser.Inspect()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get specific object number
|
// Get specific object number.
|
||||||
func (this *PdfReader) GetIndirectObjectByNumber(number int) (PdfObject, error) {
|
func (this *PdfReader) GetIndirectObjectByNumber(number int) (PdfObject, error) {
|
||||||
obj, err := this.parser.LookupByNumber(number)
|
obj, err := this.parser.LookupByNumber(number)
|
||||||
return obj, err
|
return obj, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *PdfReader) GetTrailer() (*PdfObjectDictionary, error) {
|
||||||
|
trailerDict := this.parser.GetTrailer()
|
||||||
|
if trailerDict == nil {
|
||||||
|
return nil, errors.New("Trailer missing")
|
||||||
|
}
|
||||||
|
|
||||||
|
return trailerDict, nil
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user