Add func NewPdfAnnotationWidget() *PdfAnnotationWidget

AnnotationWidget are usefull for adding Signature widgets
This commit is contained in:
Emmanuel Florent 2018-01-28 09:54:01 +01:00
parent 91660d88c4
commit f3adc44a4f

View File

@ -596,6 +596,15 @@ func NewPdfAnnotationRedact() *PdfAnnotationRedact {
return redactAnnotation
}
// Create a new annotation widget and initializes the underlying primitive.
func NewPdfAnnotationWidget() *PdfAnnotationWidget {
annotation := NewPdfAnnotation()
annotationWidget := &PdfAnnotationWidget{}
annotationWidget.PdfAnnotation = annotation
annotation.SetContext(annotationWidget)
return annotationWidget
}
// Used for PDF parsing. Loads a PDF annotation model from a PDF primitive dictionary object.
// Loads the common PDF annotation dictionary, and anything needed for the annotation subtype.
func (r *PdfReader) newPdfAnnotationFromIndirectObject(container *PdfIndirectObject) (*PdfAnnotation, error) {