public PdfCreateAnnotationRequest(CreateAnnotationArgs arguments, int priority)
     : base(arguments, priority)
 {
 }
        protected override IList <PdfAnnotation> ExecuteNative(IPdfDocument document, CreateAnnotationArgs args)
        {
            var res = new List <PdfAnnotation>();

            foreach (var annot in args.Annots)
            {
                var newAnnotHandle = document.CreateAnnotation(annot.SubType,
                                                               annot.PageNr, annot.Rect, annot.Rect.Length, annot.Colors, annot.Colors.Length, annot.BorderWidth);

                var annotSize   = Marshal.SizeOf(typeof(PdfDocument.TPdfAnnotation));
                var newAnnot    = (PdfDocument.TPdfAnnotation)Marshal.PtrToStructure(newAnnotHandle, typeof(PdfDocument.TPdfAnnotation));
                var newAnnotObj = new PdfAnnotation(newAnnot);
                annot.AnnotId = newAnnotObj.AnnotId;
                res.Add(annot);
            }

            return(res);
        }
 /// <summary>
 /// Creates the PdfCreateAnnotationRequest
 /// </summary>
 /// <param name="arguments"></param>
 public PdfCreateAnnotationRequest(CreateAnnotationArgs arguments)
     : base(arguments, 60)
 {
 }