logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Paul Rayman Posted: Sunday, March 25, 2018 10:04:57 AM(UTC)
 
Please make sure that you are using the latest version.
https://forum.patagames....released-on-Mar-19--2018

Maybe these fixes resolves your issue.

Concerning your question, you can override DrawTextHighlight method.
Code:

protected override void DrawTextHighlight(PdfBitmap bitmap, List<HighlightInfo> entries, int pageIndex)
{
    if (entries == null)
	return;

    foreach (var e in entries)
    {
        var textInfo = Document.Pages[pageIndex].Text.GetTextInfo(e.CharIndex, e.CharsCount);
        var rects = NormalizeRects(textInfo.Rects, pageIndex);
        foreach (var r in rects)
            bitmap.FillRect(r.Left, r.Top, r.Width, r.Height, e.Color, FormsBlendMode);
    }
}


The code above is a standard drawing of a text highlight using by viewer.
The code of NormilizeRects method may be found here https://github.com/Patag...aster/PdfViewer.cs#L2300


also you may override following method. In this way the standard drawing of text highlights will not be affected.
Code:

protected override void DrawTextHighlight(Graphics graphics, List<HighlightInfo> entries, int pageIndex)
edwin.rafe Posted: Sunday, March 25, 2018 9:05:49 AM(UTC)
 
I'm creating an application where I have to highlight some characters in the pdf file to help the users locate those chars.

I'm using the highlight function but sometimes, where the char is small, like a comma or a point It's very difficult to see the highlight. From my understanding the height of the highlight is the same height as the char, so thats why in small chars is difficult to see.

Is there any way that I can change the height of the highlight to make easyer for my users to find the marked chars?

As an alternative solution I've tried to draw rectangles aroud the chars overriding the OnPaint method. But I got performance issues since the on paint is called everytime I move or zoom the pdf and I had to redraw all the rectangles again.

Thanks in advance!

Regards,

Ed.