|
|
|
|
|
Originally Posted by: Paul Rayman  Hi,
You should use PdfTextObject.Font property to get the font parameters.
To find the match between selected text and PdfTextObject you can find the intersection between bounded rectangles of the selection and the bounded rectangle of the each PdfTextObject on the pages where that selection is located. I wrote the following: Code:HighlightInfo hi = new HighlightInfo();
hi.CharIndex = pdfViewerOriginal.SelectInfo.StartIndex;
hi.CharsCount = pdfViewerOriginal.SelectedText.Length;
var rects = new List<System.Drawing.Rectangle>();
for (int page = pdfViewerOriginal.SelectInfo.StartPage; page <= pdfViewerOriginal.SelectInfo.EndPage; page++)
{
rects.AddRange(pdfViewerOriginal.GetHighlightedRects(page, hi));
}
for(int i = 0; i < rects.Count; i++)
{
foreach(PdfTextObject pto in allTextObjOriginal)
{
var r = pto.BoundingBox;
if (rects[i].IntersectsWith(new System.Drawing.Rectangle((int)r.left, (int)r.top, (int)r.Width, (int)r.Height)))
{
fulltext += pto.TextAnsi;
break;
}
}
But it seems GetHighlightedRects() return Rects that change location according to the viewer's zoom. I want to get every PdfTextObject of my selected text. Kind Regars,
|
|
|
Hi,
You should use PdfTextObject.Font property to get the font parameters.
To find the match between selected text and PdfTextObject you can find the intersection between bounded rectangles of the selection and the bounded rectangle of the each PdfTextObject on the pages where that selection is located.
|
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close