Code samples
Code samples for VintaSoft Imaging .NET SDK. Here you can request a code sample.
Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions < Code samples
// subscribe to the keyup event of document
document.onkeyup = function (event) {
// if Ctrl+C key is pressed
if (event.ctrlKey && event.key === "c") {
// get the text selection tool, which is used by web document viewer
var textSelectionTool = _docViewer.getVisualToolById("TextSelectionTool");
// get selected text
var selectedText = textSelectionTool.get_SelectedText();
// copy text to the clipboard
navigator.clipboard.writeText(selectedText);
// show alert
alert("Text is copied to the clipboard.");
}
}