Пример #1
0
        /// <summary>
        /// Returns a RubberStamp with all properties set and passed Text.
        /// </summary>
        /// <param name="annotationMngr"></param>
        /// <param name="stampText"></param>
        /// <returns></returns>
        private static AnnotationRubberStamp getRubberStamp(AnnotationManager annotationMngr, string stampText)
        {
            AnnotationRubberStamp stamp = annotationMngr.AddRubberStampAnnot(Color.Red, 0.2f, 0.2f, 3.0f, 1.2f, stampText);

            stamp.BorderWidth = 0.2f;

            stamp.DashCap = System.Drawing.Drawing2D.DashCap.Flat;
            stamp.Fill    = true;
            if (stampText.Trim() == "Approved")
            {
                stamp.FillColor = Color.White;
            }
            else
            {
                stamp.FillColor = Color.Black;
            }

            stamp.FontName     = "Arial";
            stamp.FontStyle    = System.Drawing.FontStyle.Bold;
            stamp.ForeColor    = Color.Red;
            stamp.Opacity      = 100f;
            stamp.Printable    = true;
            stamp.RadiusFactor = 0.25f;
            stamp.Stroke       = true;
            stamp.StrokeColor  = Color.Red;

            return(stamp);
        }
Пример #2
0
        /// <summary>
        /// Draws the "Rejected" stamp
        /// </summary>
        /// <param name="customActionEventArgs"></param>
        /// <param name="annotationMngr"></param>
        private static void AddRejecteStampAnnotation(CustomActionEventArgs customActionEventArgs, AnnotationManager annotationMngr)
        {
            ClearAnnotation(annotationMngr, "rejected");

            AnnotationRubberStamp approvedStamp = getRubberStamp(annotationMngr, "Rejected");

            approvedStamp.Tag = "rejected";
            annotationMngr.SaveAnnotationsToPage();
            customActionEventArgs.docuVieware.ReloadAnnotations();
        }
Пример #3
0
        /// <summary>
        /// AddRubberStampAnnot adds a buffer stamp annotation to the annotation manager.
        /// </summary>
        /// <param name="leftPixels">The left coordinate of the annotation (pixels).</param>
        /// <param name="topPixels">The top coordinate of the annotation (pixels).</param>
        /// <param name="widthPixels">The width of the annotation (pixels).</param>
        /// <param name="heightPixels">The height of the annotation (pixels).</param>
        /// <param name="text">The text.</param>
        /// <param name="rotation">The rotation of the annotation in the range [0;360] (degrees, clockwise). </param>
        /// <param name="colorComponents">The components for the color for the stamp.</param>
        public void AddRubberStampAnnot(int leftPixels, int topPixels, int widthPixels, int heightPixels, string text,
                                        int rotation, byte[] colorComponents)
        {
            AnnotationRubberStamp annotationRubberStamp =
                _annotationManager.AddRubberStampAnnot(GdPictureColor(colorComponents),
                                                       ToInchesHorizontal(leftPixels), ToInchesVertical(topPixels), ToInchesHorizontal(widthPixels),
                                                       ToInchesVertical(heightPixels), text);
            GdPictureStatus status = _annotationManager.GetStat();

            if (status != GdPictureStatus.OK)
            {
                LastError = status;
            }

            annotationRubberStamp.Rotation = rotation;
        }