當前位置: 首頁>>代碼示例>>C#>>正文


C# TextRenderInfo.GetDescentLine方法代碼示例

本文整理匯總了C#中iTextSharp.text.pdf.parser.TextRenderInfo.GetDescentLine方法的典型用法代碼示例。如果您正苦於以下問題:C# TextRenderInfo.GetDescentLine方法的具體用法?C# TextRenderInfo.GetDescentLine怎麽用?C# TextRenderInfo.GetDescentLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在iTextSharp.text.pdf.parser.TextRenderInfo的用法示例。


在下文中一共展示了TextRenderInfo.GetDescentLine方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TextStyle

 /// <summary>
 /// Creates a TextStyle object by getting the font name and font size
 /// from a TextRenderInfo object.
 /// </summary>
 /// <param name="textRenderInfo">Object that contains info about a text snippet</param>
 public TextStyle(TextRenderInfo textRenderInfo)
 {
     String font = textRenderInfo.GetFont().FullFontName[0][3];
     if (font.Contains("+"))
         font = font.Substring(font.IndexOf("+") + 1, font.Length - font.IndexOf("+") - 1);
     if (font.Contains("-"))
         font = font.Substring(0, font.IndexOf("-"));
     this.fontName = font;
     this.fontSize = textRenderInfo.GetAscentLine().GetStartPoint()[1] - textRenderInfo.GetDescentLine().GetStartPoint()[1];
 }
開發者ID:Niladri24dutta,項目名稱:itextsharp,代碼行數:15,代碼來源:TextStyle.cs

示例2: RenderText

        /**
         * Method invokes by the PdfContentStreamProcessor.
         * Passes a TextRenderInfo for every text chunk that is encountered.
         * We'll use this object to obtain coordinates.
         * @see com.itextpdf.text.pdf.parser.RenderListener#renderText(com.itextpdf.text.pdf.parser.TextRenderInfo)
         */
        virtual public void RenderText(TextRenderInfo renderInfo) {
            if (textRectangle == null)
                textRectangle = renderInfo.GetDescentLine().GetBoundingRectange();
            else
                textRectangle.Add(renderInfo.GetDescentLine().GetBoundingRectange());
            
            textRectangle.Add(renderInfo.GetAscentLine().GetBoundingRectange());

        }
開發者ID:jagruti23,項目名稱:itextsharp,代碼行數:15,代碼來源:TextMarginFinder.cs

示例3: GetRectangle

 /// <summary>
 /// Stores the start and end points and the ascent and descent info from
 /// a text snippet into a Rectangle object.
 /// </summary>
 /// <param name="textRenderInfo">Object that contains info about a text snippet</param>
 /// <returns>coordinates in the form of a Rectangle object</returns>
 static Rectangle GetRectangle(TextRenderInfo textRenderInfo)
 {
     LineSegment descentLine = textRenderInfo.GetDescentLine();
     LineSegment ascentLine = textRenderInfo.GetAscentLine();
     float x0 = descentLine.GetStartPoint()[0];
     float x1 = descentLine.GetEndPoint()[0];
     float y0 = descentLine.GetStartPoint()[1];
     float y1 = ascentLine.GetEndPoint()[1];
     return new Rectangle(x0, y0, x1, y1);
 }
開發者ID:Niladri24dutta,項目名稱:itextsharp,代碼行數:16,代碼來源:TextItemSimple.cs

示例4: AllowText

        public override bool AllowText(TextRenderInfo renderInfo) {
            LineSegment ascent = renderInfo.GetAscentLine();
            LineSegment descent = renderInfo.GetDescentLine();

            Rectangle r1 = new Rectangle(Math.Min(descent.GetStartPoint()[0], descent.GetEndPoint()[0]),
                                         descent.GetStartPoint()[1],
                                         Math.Max(descent.GetStartPoint()[0], descent.GetEndPoint()[0]),
                                         ascent.GetEndPoint()[1]);

            foreach (Rectangle rectangle in rectangles) {
                if (Intersect(r1, rectangle)) {
                    return false;
                }
            }

            return true;
        }
開發者ID:Niladri24dutta,項目名稱:itextsharp,代碼行數:17,代碼來源:PdfCleanUpRegionFilter.cs

示例5: RenderText

        public override void RenderText(TextRenderInfo renderInfo)
        {
            base.RenderText(renderInfo);

            var bottomLeft = renderInfo.GetDescentLine().GetStartPoint();
            var topRight = renderInfo.GetAscentLine().GetEndPoint();

            var rect = new iTextSharp.text.Rectangle(
                bottomLeft[Vector.I1],
                bottomLeft[Vector.I2],
                topRight[Vector.I1],
                topRight[Vector.I2]
            );

            this.containers.Add(new TextContainer()
            {
                Container = rect,
                Text = renderInfo.GetText()
            });
        }
開發者ID:MalakhovVladislav,項目名稱:practice,代碼行數:20,代碼來源:TextBlocksLocationStrategy.cs

示例6: AllowText

        public override bool AllowText(TextRenderInfo renderInfo) {
            LineSegment ascent = renderInfo.GetAscentLine();
            LineSegment descent = renderInfo.GetDescentLine();

        Point2D[] glyphRect = new Point2D[] {
                new Point2D.Float(ascent.GetStartPoint()[0], ascent.GetStartPoint()[1]),
                new Point2D.Float(ascent.GetEndPoint()[0], ascent.GetEndPoint()[1]),
                new Point2D.Float(descent.GetEndPoint()[0], descent.GetEndPoint()[1]),
                new Point2D.Float(descent.GetStartPoint()[0], descent.GetStartPoint()[1]),
        };

            foreach (Rectangle rectangle in rectangles) {
                Point2D[] redactRect = GetVertices(rectangle);

                if (Intersect(glyphRect, redactRect)) {
                    return false;
                }
            }

            return true;
        }
開發者ID:htlp,項目名稱:itextsharp,代碼行數:21,代碼來源:PdfCleanUpRegionFilter.cs

示例7: RenderText

        //Automatically called for each chunk of text in the PDF
        public override void RenderText(TextRenderInfo renderInfo) {
            base.RenderText(renderInfo);

            //Get the bounding box for the chunk of text
            var bottomLeft = renderInfo.GetDescentLine().GetStartPoint();
            var topRight = renderInfo.GetAscentLine().GetEndPoint();

            //Create a rectangle from it
            var rect = new iTextSharp.text.Rectangle(
                                                    bottomLeft[Vector.I1],
                                                    bottomLeft[Vector.I2],
                                                    topRight[Vector.I1],
                                                    topRight[Vector.I2]
                                                    );

            //Add this to our main collection
            this.myPoints.Add(new RectAndText(rect, renderInfo.GetText()));
        }
開發者ID:LupinIIIit,項目名稱:Splendor.Web,代碼行數:19,代碼來源:FileUploadController.cs

示例8: RenderText

 public virtual void RenderText(TextRenderInfo renderInfo) {
     Vector startPoint = renderInfo.GetDescentLine().GetStartPoint();
     Vector endPoint = renderInfo.GetAscentLine().GetEndPoint();
     float x1 = Math.Min(startPoint[0], endPoint[0]);
     float x2 = Math.Max(startPoint[0], endPoint[0]);
     float y1 = Math.Min(startPoint[1], endPoint[1]);
     float y2 = Math.Max(startPoint[1], endPoint[1]);
     rectangles.Add(new Rectangle(x1, y1, x2, y2));
 }
開發者ID:newlysoft,項目名稱:itextsharp,代碼行數:9,代碼來源:HighlightItemsTest.cs

示例9: RenderText

 /// <summary>
 /// 
 /// </summary>
 /// <param name="renderInfo"></param>
 public override void RenderText(TextRenderInfo renderInfo)
 {
     iTextSharp.text.pdf.parser.LineSegment segment = renderInfo.GetBaseline();
     TextChunkEx location = new TextChunkEx(renderInfo.GetText(), segment.GetStartPoint(), segment.GetEndPoint(), renderInfo.GetSingleSpaceWidth(), renderInfo.GetAscentLine(), renderInfo.GetDescentLine());
     m_locationResult.Add(location);
 }
開發者ID:robdobsn,項目名稱:ScanMonitor,代碼行數:10,代碼來源:PdfTextAndLocExtractor.cs

示例10: RenderText

 /// <summary>
 /// 
 /// </summary>
 /// <param name="renderInfo"></param>
 public override void RenderText(TextRenderInfo renderInfo)
 {
     LineSegment segment = renderInfo.GetBaseline();
     string x = renderInfo.GetText();
     TextChunk location = new TextChunk(renderInfo.GetText(), segment.GetStartPoint(), segment.GetEndPoint(), renderInfo.GetSingleSpaceWidth(), renderInfo.GetAscentLine(), renderInfo.GetDescentLine());
     m_locationResult.Add(location);
 }
開發者ID:xmalmorthen,項目名稱:FindAndHighLight,代碼行數:11,代碼來源:Searcher.cs


注:本文中的iTextSharp.text.pdf.parser.TextRenderInfo.GetDescentLine方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。