如何在HTML中加载Flash(2种实现方法)_HTML/Xhtml_网页制作

点评:如何在HTML中加载Flash,为网页添加更多的色彩,普通的网页以无法满足用户的需求,接下来为大家介绍下2种在HTML中加载Flash的方法,感兴趣的各位可以适当参考下,希望对你有所帮助

 

第一种方法
css 代码:

.b970-a{width:970px; height:103px; margin:4px auto; overflow:hidden;}
html 代码:
<div class="b970-a"> <
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="970" height="107">
<param name="movie" value="images/flash_ad-3-26.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed src="images/flash_ad-3-26.swf" width="970" height="107" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed>
</object>
</div>

 

第二种方法 兼容性好
css 代码:

 

.b970-a{width:970px; height:103px; margin:5px auto; z-index:2; overflow:hidden;}
html 代码:
<object width="970" height="103"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="images/flash_ad-3-26.swf" name="movie">
<param value="high" name="quality">
<param value="transparent" name="wmode">
<param value="exactfit" name="SCALE">
<embed width="970" height="103" wmode="transparent" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
quality="high" src="images/flash_ad-3-26.swf">
</object>

转载于:https://www.cnblogs.com/dexjinkey/p/6093090.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Java实现网页转PDF,可以使用第三方库iText或Flying Saucer。 iText是一个流行的Java PDF库,可以用于创建、处理和修改PDF文件。它具有很好的支持HTML到PDF的转换功能。 使用iText的HTML到PDF转换非常简单。首先,需要将HTML文件读入内存,然后使用iText的HTMLWorker类将其转换为PDF格式。下面是一个示例代码: ```java //读取HTML文件 String html = FileUtils.readFileToString(new File("path/to/html/file"), "UTF-8"); //创建PDF文档 Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream("path/to/pdf/file")); document.open(); //将HTML转换为PDF HTMLWorker htmlWorker = new HTMLWorker(document); htmlWorker.parse(new StringReader(html)); //关闭文档 document.close(); ``` Flying Saucer是另一个Java库,它基于iText,并提供了更高级的HTML和CSS渲染功能。与iText不同,Flying Saucer将HTML转换为XHTML格式,然后使用iText将其转换为PDF。 下面是使用Flying Saucer实现网页转PDF的示例代码: ```java //读取HTML文件 String html = FileUtils.readFileToString(new File("path/to/html/file"), "UTF-8"); //创建PDF文档 Document document = new Document(); PdfWriter.getInstance(document, new FileOutputStream("path/to/pdf/file")); document.open(); //将HTML转换为PDF ITextRenderer renderer = new ITextRenderer(); renderer.setDocumentFromString(html); renderer.layout(); renderer.createPDF(new FileOutputStream("path/to/pdf/file")); //关闭文档 document.close(); ``` 无论使用哪个库,都需要注意HTML文件的格式和样式,以确保转换后的PDF文档符合预期。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值