how to enable annotation of adobe pdf reader control

605 views Asked by At

I tried adobe reader control in window .net stand alone application ,but it annotation is disable, if there any way to enable annotation of adobe pdf reader control.

 private void HighlightTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PdfReader reader = new PdfReader(filename);

            //this.Close();

           using (FileStream fs = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.None))
            {

                using (PdfStamper stamper = new PdfStamper(reader, fs))
                {
                    //Create a rectangle for the highlight. NOTE: Technically this isn't used but it helps with the quadpoint calculation
                    iTextSharp.text.Rectangle rect = new iTextSharp.text.Rectangle(60.6755f, 749.172f, 94.0195f, 735.3f);

                    float[] quad = { rect.Left, rect.Bottom, rect.Right, rect.Bottom, rect.Left, rect.Top, rect.Right, rect.Top };

                    //Create our hightlight
                    PdfAnnotation highlight = PdfAnnotation.CreateMarkup(stamper.Writer, rect, null, PdfAnnotation.MARKUP_HIGHLIGHT, quad);

                    // Set the color
                    highlight.Color = BaseColor.YELLOW;

                    // Add the annotation
                    stamper.AddAnnotation(highlight, 1);
                    //}

i tried to highlighted selected text using itextsharp but it create new file . I want require code for highlighted text in open pdf file using adobe pdf reader control.

0

There are 0 answers