Page 1 of 1

Highlight Text tool

Posted: Thu Jun 23, 2011 5:47 pm
by Vladimir
Hello,

Is it possible to implement the functionality like Highlight Text tool in Adobe Acrobat by using VintaSoftImaging.NET SDK?

I mean the possibility to select some paragraphs and save this selection in pdf file.

Regards,
Vladimir.

Re: Highlight Text tool

Posted: Fri Jun 24, 2011 1:37 pm
by Yuri
Hello,

Use on-page drawing opportunities with necessary color, transparence and color blending.

Here is a snippet of code which highlights selected text (put it as new button in our PDFEditorDemo):

Code: Select all

private void highlightSelectedTextToolStripMenuItem_Click(object sender,
 EventArgs e)
 {
 if (imageViewer.CurrentTool == _viewerTool)
 if (_viewerTool.SelectedRegion != null)
 {
 using (PdfGraphics graphics = PdfGraphics.FromPage(FocusedPage))
 {
 Color color = Color.FromArgb(70, 255, 255, 0);
 PdfBrush brush = new PdfBrush(color,
 GraphicsStateBlendMode.Multiply);
 TextRegionLine[] lines = _viewerTool.SelectedRegion.Lines;
 for (int i = 0; i < lines.Length; i++)
 graphics.FillPolygon(brush,
 lines[i].SelectionRegion.PolygonPoints);
 }
 imageViewer.FocusedImage.Reload(true);
 }
 }
Sincerely, Yuri

Re: Highlight Text tool

Posted: Fri Jun 24, 2011 2:22 pm
by Vladimir
Thank you very much!