最近遇到一个问题:
要求把html代码如(“<input value=value>”)以html格式粘贴到word中(即粘贴到word中后并不是文本,而是一个html文本框)
找了好久资料,终于解决.
首先请看html格式的数据在剪切版中的存放格式:
Version:0.9 // Version number of the clipboard. Starting version is 0.9.
StartHTML:71 // Byte count from the beginning of the clipboard to the start of the context, or -1 if no context
EndHTML:170 // Byte count from the beginning of the clipboard to the end of the context, or -1 if no context.
StartFragment:140 // Byte count from the beginning of the clipboard to the start of the fragment.
EndFragment:160 // Byte count from the beginning of the clipboard to the end of the fragment.
StartSelection:140 // Byte count from the beginning of the clipboard to the start of the selection.
EndSelection:160 // Byte count from the beginning of the clipboard to the end of the selection.
<!DOCTYPE>
<HTML>
<HEAD>
<TITLE>The HTML Clipboard</TITLE>
<BASE HREF="http://sample/specs">
<