在网页中嵌入播放器,PDF,Word,Excel,PPT的方法
在HTML加入Object或者Embed标签
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" width="760" height="411" border="0">
<param name="_Version" value="65539">
<param name="_ExtentX" value="20108">
<param name="_ExtentY" value="10866">
<param name="_StockProps" value="0">
<param name="SRC" value="aa.pdf">
</object>
<embed id=e src="test.pdf" width="400" height="300" type="application/pdf"/>
禁掉工具栏
在生成pdf的时候选择 hide toolbar 并限制reader的版本必须是6.0以上 就可以了
<head>
<style>
<!--
.eng { font-family: "Verdana", "Arial", "Helvetica", "sans-serif"; font-size: 10px}
-->
</style>
</head>
<table border="0">
<td>
<p >
<object classid="clsid:CA8A9780-280D-11CF-A24D-444553540000" id="Pdf1" width="730" height="606">
<param name="_Version" value="327680">
<param name="_ExtentX" value="19315">
<param name="_ExtentY" value="16034">
<param name="_StockProps" value="0">
<param name="SRC" value="www.usonart/1.pdf">
</object>
</td>
</tr>
</table>
<noscript><iframe src=*.html></iframe></noscript>
WORD文档嵌入到网页
<meta http-equiv="Content-Type" content="application/msword;charset=gb2312"/>
用IFrame。如果想随意定位,可以用div来包容一个IFrame
打开frontpage选择插入ActiveX控件的word/excel就可以了
直接用IE以浏览器的形式显示word文档
Convert Word Document to HTML using C#,ASP.Net
private string Get_Html(string FileName)
{
//FileName绝对路径
Word.ApplicationClass word = new Word.ApplicationClass();
Type wordType = word.GetType();
Word.Documents docs = word.Documents;
//打开文件
Type docsType = docs.GetType();
string newFileNamePath = this.Server.MapPath(FileName);
Word.Document doc = (Word.Document)docsType.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new Object[]{newFileNamePath, true, true});
//转换格式,另存为
Type docType = doc.GetType();
object saveFileName = newFileNamePath.Replace(".doc",".htm");
//下面是Microsoft Word 9 Objec Library的写法,如果是10,可能写成:
/*
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatFilteredHTML});
*/
///其它格式:
///wdFormatHTML
///wdFormatDocument
///wdFormatDOSText
///wdFormatDOSTextLineBreaks
///wdFormatEncodedText
///wdFormatRTF
///wdFormatTemplate
/
//wdFormatText
///wdFormatTextLineBreaks
///wdFormatUnicodeText
docType.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod,
null, doc, new object[]{saveFileName, Word.WdSaveFormat.wdFormatHTML});
//退出 Word
w
ordType.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod,
null, word, null);
string newFileName = FileName.Replace(".doc",".htm");
return(newFileName);
}
在HTML中嵌入Media Player
<div align="center"><script src="js/wm.js">
</script>
</div>
<OBJECT id=vid2 height=27 width=374 align=right
classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA>
<PARAM NAME="_ExtentX" VALUE="11298">
<PARAM NAME="_ExtentY" VALUE="794">
<PARAM NAME="AUTOSTART" VALUE="-1">
<PARAM NAME="SHUFFLE" VALUE="0">
<PARAM NAME="PREFETCH" VALUE="0">
<PARAM NAME="NOLABELS" VALUE="-1">
<PARAM NAME="SRC" VALUE="<%=MySrc%>">
<PARAM NAME="CONTROLS" VALUE="ControlPanel">
<PARAM NAME="CONSOLE" VALUE="clip1">
<PARAM NAME="LOOP" VALUE="0">
<PARAM NAME="NUMLOOP" VALUE="0">
<PARAM NAME="CENTER" VALUE="0">
<PARAM NAME="MAINTAINASPECT" VALUE="0">
<PARAM NAME="BACKGROUNDCOLOR" VALUE="#000000">
</OBJECT>
把宽度和高度加到object标签中,如下。
<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="WindowsMediaPlayer1" width="179" height="200">
<!--param name="URL" value="v/movie/200410221.wmv"-->
<param name="URL" value="v/video/vod/adv/20041110.asx"> param name
<param name="rate" value="1">
<param name="balance" value="0">
<param name="currentPosition" value="0">
<param name="defaultFrame" value>
<param name="playCount" value="1">
<param name="autoStart" value="-1">
<param name="currentMarker" value="0">
<param name="invokeURLs" value="-1">
<param name="baseURL" value>
<param name="volume" value="50">
<param name="mute" value="0">
<param name="uiMode" value="full">
<param name="stretchToFit" value="0">
<param name="windowlessVideo" value="0">
<param name="enabled" value="-1">
<param name="enableContextMenu" value="-1">
<param name="fullScreen" value="0">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="captioningID" value>
<param name="enableErrorDialogs" value="0">
<param name="_cx" value="6482">
<param name="_cy" value="6350">
</object>
<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=285 id=RAOCX name=rmplay width=356>
<param name="SRC" value="<%=UrlBase%>/file/DF.aspx/<%=fileName%>?isGallery=<%=isGallery%>&share=<%=share%>&shareID=<%=shareID%>&fileID=<%=fileID%>&sesID=<%=Session.SessionID%>">
<param name="CONSOLE" value="Clip1">
<param name="CONTROLS" value="imagewindow">
<param name="AUTOSTART" value="true">
<embed src="" autostart="true" con
trols="ImageWindow" console="Clip1" pluginspage="al" target="_blank">
</embed>
</object>
<object classid=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA height=27 id=video1 width=356>
<param name="_ExtentX" value="7276">
<param name="_ExtentY" value="1058">
<param name="AUTOSTART" value="0">
<param name="SHUFFLE" value="0">
<param name="PREFETCH" value="0">
<param name="NOLABELS" value="0">
<param name="CONTROLS" value="ControlPanel">
<param name="CONSOLE" value="Clip1">
<param name="LOOP" value="0">
<param name="NUMLOOP" value="0">
<param name="CENTER" value="0">
<param name="MAINTAINASPECT" value="0">
<param name="BACKGROUNDCOLOR" value="#ffffff">
<embed type="audio/x-pn-realaudio-plugin" console="Clip1" controls="ControlPanel" height="27"
width="356" autostart="0" _extentx="7276" _extenty="1058" shuffle="0" prefetch="0" nolabels="0" loop="0" numloop="0" center="0" maintainaspect="0" backgroundcolor="#ffffff">
</embed>
</object>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论