private static pdftron.PDF.Annots.RubberStamp setRubberStamp(RubberStamp rubberStamp)
        {
            pdftron.PDF.Annots.RubberStamp stamp = pdftron.PDF.Annots.RubberStamp.Create(_currentDoc, AnnotationsMannager.ConvertRect(rubberStamp.RectArea()));
            stamp.SetIcon(pdftron.PDF.Annots.RubberStamp.Icon.e_Approved);//Enum of possible values for icon (text)
            stamp.SetInteriorColor(AnnotationsMannager.ConvertColor(new double[] { rubberStamp.ColorRed(), rubberStamp.ColorGreen(), rubberStamp.ColorBlue() }), 3);
            stamp.SetOpacity(.4);

            return(stamp);
        }
        private static pdftron.PDF.Annots.FreeText setFreeText(FreeText ft, bool fromViewer)
        {
            Rect r = AnnotationsMannager.ConvertRect(ft.RectArea());

            pdftron.PDF.Annots.FreeText freetext = pdftron.PDF.Annots.FreeText.Create(_currentDoc, r);
            freetext.SetFontSize(20);
            freetext.SetTextColor(AnnotationsMannager.ConvertColor(new double[] { ft.ColorRed(), ft.ColorGreen(), ft.ColorBlue() }), 3);

            if (!fromViewer)
            {
                freetext.SetContents(ft.Text());
            }

            return(freetext);
        }
        public static Annot CreatePDFAnnotation(BaseAnnotation annotation, PDFDoc pdfDocument, bool fromViewer)
        {
            _currentDoc = pdfDocument;
            Annot pdfAnnotation;

            switch (annotation.Properties.PropertyName)
            {
            case XMLHighlightText.Names.Highlight:
            case XMLHighlightArea.Names.Highlight:
                pdfAnnotation = setHighlight(annotation);
                break;

            case StickyNote.Names.StickyNote:
                pdfAnnotation = setStickyNote((StickyNote)annotation, fromViewer);
                break;

            case MarkArea.Names.MarkArea:
                pdfAnnotation = setMarkArea((MarkArea)annotation);
                break;

            case FreeText.Names.FreeText:
                pdfAnnotation = setFreeText((FreeText)annotation, fromViewer);
                break;

            case Circle.Names.Circle:
                pdfAnnotation = setCircle((Circle)annotation);
                break;

            case Square.Names.Square:
                pdfAnnotation = setSquare((Square)annotation);
                break;

            case Line.Names.Line:
                pdfAnnotation = setLine((Line)annotation);
                break;

            case StamperImage.Names.Stamper:
                pdfAnnotation = setStamperImage((StamperImage)annotation);
                break;

            case StamperText.Names.Stamper:
                pdfAnnotation = setStamperText((StamperText)annotation);
                break;

            case RubberStamp.Names.RubberStamp:
                pdfAnnotation = setRubberStamp((RubberStamp)annotation);
                break;

            case XMLSquiggly.Names.Squiggly:
                pdfAnnotation = setSquiggly((XMLSquiggly)annotation);
                break;

            case XMLStrikeout.Names.Strikeout:
                pdfAnnotation = setStrikeout((XMLStrikeout)annotation);
                break;

            case XMLUnderline.Names.Underline:
                pdfAnnotation = setUnderline((XMLUnderline)annotation);
                break;

            default:
                pdfAnnotation = Annot.Create(null, Annot.Type.e_3D, null);     // For Compiler. Should never execute this
                break;
            }

            if (!(annotation is FreeText)) // Quick Fix, need to revamp it
            {
                pdfAnnotation.SetColor(AnnotationsMannager.ConvertColor(new double[] { annotation.ColorRed(), annotation.ColorGreen(), annotation.ColorBlue() }), 3);
            }

            _currentDoc.GetPage(annotation.Page()).AnnotPushBack(pdfAnnotation);
            return(pdfAnnotation);
        }