https://github.com/stevencohn/clipboardconverter
PoC convert copied RTF content to HTML using the clipboard
https://github.com/stevencohn/clipboardconverter
clipboard html onenote rtf
Last synced: 4 months ago
JSON representation
PoC convert copied RTF content to HTML using the clipboard
- Host: GitHub
- URL: https://github.com/stevencohn/clipboardconverter
- Owner: stevencohn
- License: mit
- Created: 2020-03-31T14:51:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-05-02T16:56:01.000Z (over 1 year ago)
- Last Synced: 2025-02-24T09:22:30.991Z (8 months ago)
- Topics: clipboard, html, onenote, rtf
- Language: C#
- Size: 21.5 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ClipboardRtfToHtml
This project was my sandbox for playing with solutions to paste rich text from Visual
Studio into OneNote, preserving colorized syntax highlighting.OneNote doesn't allow pasting RTF directly; it never seemed to implement that feature
and instead just pastes the raw text. So this solution uses the clipboard as a working
buffer to convert RTF to HTML.The conversion is done using the .NET WPF RichTextBox component control. It can take
RTF and convert its content to XAML. We can then parse the XAML and convert it HTML.Then the easiest way to get the HTML into OneNote, without hacking away at the page
HTML directly, is to paste it from the clipboard. This is done simply by invoking
the Ctrl-V key sequence.## Command Line
PS> **.\converter.exe [--dump]**
By default, this console application grabs RTF on the clipboard and converts
it to HTML.The --dump argument simply prints out the contents of the clipboard without
any further processing.