小编Kar*_*hik的帖子

使用itextsharp突出显示pdf中的单词,而不是在浏览器中显示突出显示的单词

使用itextsharp在浏览器中不显示突出显示的单词.

土砖

在此输入图像描述

浏览器

在此输入图像描述

 List<iTextSharp.text.Rectangle> MatchesFound = strategy.GetTextLocations(splitText[i].Trim(), StringComparison.CurrentCultureIgnoreCase);
                    foreach (Rectangle rect in MatchesFound)
                    {
                        float[] quad = { rect.Left - 3.0f, rect.Bottom, rect.Right, rect.Bottom, rect.Left - 3.0f, rect.Top + 1.0f, rect.Right, rect.Top + 1.0f };
                        //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, pageno);
                        
                    }
Run Code Online (Sandbox Code Playgroud)

请帮我解决这个问题.

更新代码

  private void highlightPDF()
{
    //Create a simple test file
    string outputFile = Server.MapPath("~/pdf/16193037V_Dhana-FI_NK-QA_Completed.pdf");
    string filename = "HL" + Convert.ToString(Session["Filename"]) …
Run Code Online (Sandbox Code Playgroud)

c# syntax-highlighting itextsharp

1
推荐指数
1
解决办法
4912
查看次数

标签 统计

c# ×1

itextsharp ×1

syntax-highlighting ×1