Annotations fix

https://github.com/unidoc/unidoc/issues/41
This commit is contained in:
Gunnsteinn Hall 2017-04-21 12:08:58 +00:00
parent f36575d3e4
commit 57e576344c
2 changed files with 23 additions and 23 deletions

View File

@ -22,23 +22,22 @@ import (
// PDF page object (7.7.3.3 - Table 30). // PDF page object (7.7.3.3 - Table 30).
type PdfPage struct { type PdfPage struct {
Parent PdfObject Parent PdfObject
LastModified *PdfDate LastModified *PdfDate
Resources *PdfPageResources Resources *PdfPageResources
CropBox *PdfRectangle CropBox *PdfRectangle
MediaBox *PdfRectangle MediaBox *PdfRectangle
BleedBox *PdfRectangle BleedBox *PdfRectangle
TrimBox *PdfRectangle TrimBox *PdfRectangle
ArtBox *PdfRectangle ArtBox *PdfRectangle
BoxColorInfo PdfObject BoxColorInfo PdfObject
Contents PdfObject Contents PdfObject
Rotate *int64 Rotate *int64
Group PdfObject Group PdfObject
Thumb PdfObject Thumb PdfObject
B PdfObject B PdfObject
Dur PdfObject Dur PdfObject
Trans PdfObject Trans PdfObject
//Annots PdfObject
AA PdfObject AA PdfObject
Metadata PdfObject Metadata PdfObject
PieceInfo PdfObject PieceInfo PdfObject
@ -51,7 +50,7 @@ type PdfPage struct {
PresSteps PdfObject PresSteps PdfObject
UserUnit PdfObject UserUnit PdfObject
VP PdfObject VP PdfObject
//Annotations
Annotations []*PdfAnnotation Annotations []*PdfAnnotation
// Primitive container. // Primitive container.

View File

@ -462,11 +462,6 @@ func (this *PdfReader) loadForms() (*PdfAcroForm, error) {
common.Log.Trace("Has Acro forms") common.Log.Trace("Has Acro forms")
// Load it. // Load it.
acroForm, err := this.newPdfAcroFormFromDict(formsDict)
if err != nil {
return nil, err
}
// Ensure we have access to everything. // Ensure we have access to everything.
common.Log.Trace("Traverse the Acroforms structure") common.Log.Trace("Traverse the Acroforms structure")
err = this.traverseObjectData(formsDict) err = this.traverseObjectData(formsDict)
@ -475,6 +470,12 @@ func (this *PdfReader) loadForms() (*PdfAcroForm, error) {
return nil, err return nil, err
} }
// Create the acro forms object.
acroForm, err := this.newPdfAcroFormFromDict(formsDict)
if err != nil {
return nil, err
}
return acroForm, nil return acroForm, nil
} }