This is a migrated thread and some comments may be shown as answers.

Copy text in PDF Viewer?

6 Answers 214 Views
PDFViewer
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 20 Jul 2012, 11:25 AM
How can I select and copy text to the clipboard with PDF Viewer in Q2?

I couldn't find anything in the documentation?

There is a copy method but I cannot select text in the viewer control with the mouse.

regards,
Victor

6 Answers, 1 is accepted

Sort by
0
Kammen
Telerik team
answered on 20 Jul 2012, 01:32 PM
Hello Victor,

From Q2 RadPdfViewer has a new property called Mode, which controls the current mode (Pan / TextSelection). When you use the text selection mode, you will be able to use the mouse to select text.

Then, using the Ctrl + C key binding (by default) the text will be copied to the clipboard.

In addition, you can easily select and copy text in code behind. Here is sample code illustrating how this can be done: 

public void ShowSelectionAndCopyFeature()
{
    TextPosition position = new TextPosition                                                                       (this.viewer.Document.CaretPosition);
    position.MoveLineDown();
    position.MoveLineDown();
  
    position.MoveToLineStart();
  
    TextPosition position2 = new TextPosition(position);
    position2.MoveToNextWord();
    position2.MoveToNextPosition();
  
    this.viewer.Select(position, position2);
  
    this.viewer.Copy();
  
    MessageBox.Show(this.viewer.GetSelectedText());
}

I hope this helps.


Regards,
Kammen
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Victor
Top achievements
Rank 1
answered on 20 Jul 2012, 02:58 PM
Hello Kammen,

Thank you, that did it.

I am really happy that Telerik is improving the PDF Viewer with each release.

Kind regards,
Victor
0
Umapathi
Top achievements
Rank 1
answered on 12 Sep 2012, 07:11 AM
Hi all.,



Will this work in Windows 8 store apps?? The Pdf file Viewer should be within  Windows 8 store apps...





Thanks

  Umapathi
0
Georgi
Telerik team
answered on 13 Sep 2012, 08:35 AM
Hi Umapathi,

Thank you for your question.

We are currently evaluating the user scenarios that may require a PDF Viewer for Windows Store apps. We have the control in our radar but I cannot give any estimation on its availability, so stay tuned for more information to come :)

I hope this information is useful. Let me know if I can help you in some other way.

Greetings,
Georgi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Will
Top achievements
Rank 1
answered on 06 Nov 2012, 09:36 PM
The ability to embed this PDFViewer into a Windows Store app will be huge for us. I've been searching for a solution for days and came across Foxit that can do the job. But I've had bad tech support from them so I'm trying to stay away from using their products again. Please keep me posted as soon as this product is available for use in Windows Store app. Thanks.
0
Ivaylo Gergov
Telerik team
answered on 12 Nov 2012, 08:18 AM
Hi, Will

Thank you for your trust.

The interest for PDF Viewer is growing and as soon as we have more clarity about this question I will contact you immediately.

If you have any other questions or ideas do not hesitate to write us again.

Regards,
Ivaylo Gergov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PDFViewer
Asked by
Victor
Top achievements
Rank 1
Answers by
Kammen
Telerik team
Victor
Top achievements
Rank 1
Umapathi
Top achievements
Rank 1
Georgi
Telerik team
Will
Top achievements
Rank 1
Ivaylo Gergov
Telerik team
Share this question
or