如何启用adobe pdf阅读器控件的注释

时间:2013-11-30 06:34:10

标签: c# pdf pdf-reader

我在window .net独立应用程序中尝试了adobe reader control,但是如果有任何方法可以启用adobe pdf reader控件的注释,那么它的注释是禁用的。

 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);
                    //}

我尝试使用itextsharp突出显示所选文本,但它会创建新文件。我想要使​​用adobe pdf reader control在open pdf文件中输入突出显示文本的代码。

0 个答案:

没有答案