Reads available formats for the clipboard type
Optional
type: ClipboardSelectionTypeClipboard Type defaults to 'clipboard', use 'selection' for linux
Read the content of the clipboard as Html
Optional
type: ClipboardSelectionTypeClipboard Type defaults to 'clipboard', use 'selection' for linux
Read the content of the clipboard as a base64 string or a dataURL based on the input parameter 'format', defaults to 'dataURL'
Clipboard Read Image request with formatting options
// see TS type: OpenFin.ImageFormatOptions
const pngOrDataURLOrBmpOptions = {
format: 'png', // can be: 'png' | 'dataURL' | 'bmp'
};
const jpgOptions = {
format: 'jpg',
quality: 80 // optional, if omitted defaults to 100
};
fin.Clipboard.readImage(pngOrDataURLOrBmpOptions)
.then(image => console.log('Image read from clipboard as PNG, DataURL or BMP', image))
.catch(err => console.log(err));
fin.Clipboard.readImage(jpgOptions)
.then(image => console.log('Image read from clipboard as JPG', image))
.catch(err => console.log(err));
// defaults to {format: 'dataURL'}
fin.Clipboard.readImage()
.then(image => console.log('Image read from clipboard as DataURL', image))
.catch(err => console.log(err));
Read the content of the clipboard as Rtf
Optional
type: ClipboardSelectionTypeClipboard Type defaults to 'clipboard', use 'selection' for linux
Read the content of the clipboard as plain text
Optional
type: ClipboardSelectionTypeClipboard Type defaults to 'clipboard', use 'selection' for linux
Writes data into the clipboard
The object for writing data into the clipboard
fin.Clipboard.write({
data: {
text: 'a',
html: 'b',
rtf: 'c',
// Can be either a base64 string, or a DataURL string. If using DataURL, the
// supported formats are `data:image/png[;base64],` and `data:image/jpeg[;base64],`.
// Using other image/<format> DataURLs will throw an Error.
image: '...'
}
}).then(() => console.log('write data into clipboard')).catch(err => console.log(err));
Writes data into the clipboard as Html
The object for writing data into the clipboard
Writes data into the clipboard as an Image
The object to write an image to the clipboard
Writes data into the clipboard as Rtf
The object for writing data into the clipboard
Writes data into the clipboard as plain text
The object for writing data into the clipboard
The Clipboard API allows reading and writing to the clipboard in multiple formats.