IE浏览器提示保存文件navcancl解决办法
点“开始->运行”输入“iexplore.exe -nohome -extoff” 打开浏览器
首先取消锁定工具栏,禁用你安装的其他第三方工具栏..
然后打开 工具->internet选项->高级->将“SmartScreen筛选器”勾掉.
实现鼠标拖动div交换位置
月影 body {margin:0px;padding:0px;font-size:12px;text-align:center;} body > div {text-align:center; margin-right:auto; margin-left:auto;} .content{width:900px;} .content .left{ float:left; width:20%; border:1px solid #FF0000; margin:3px; } .content .center{float:left;border:1px solid #FF0000;margin:3px;width:57%} .content .right{float:right;width:20%;border:1px solid #FF0000;margin:3px} .mo{height:auto;border:1px solid #CCC;margin:3px;background:#FFF} .mo h1{background:#ECF9FF;height:18px;padding:3px;cursor:move} .mo .nr{height:80px;border:1px solid #F3F3F3;margin:2px} h1{margin:0px;padding:0px;text-align:left;font-size:12px} var dragobj={} window.onerror=function(){return false} function on_ini(){ String.prototype.inc=function(s){return this.indexOf(s)>-1?true:false} var agent=navigator.userAgent window.isOpr=agent.inc("Opera") window.isIE=agent.inc("IE")&&!isOpr window.isMoz=agent.inc("Mozilla")&&!isOpr&&!isIE if(isMoz){ Event.prototype.__defineGetter__("x",function(){return this.clientX+2}) Event.prototype.__defineGetter__("y",function(){return this.clientY+2}) } basic_ini() } function basic_ini(){ window.$=function(obj){return typeof(obj)=="string"?document.getElementById(obj):obj} window.oDel=function(obj){if($(obj)!=null){$(obj).parentNode.removeChild($(obj))}} } window.onload=function(){ on_ini() var o=document.getElementsByTagName("h1") for(var i=0;ia[1]&&e.xa[0]&&e.y<(a[0]+a[3])){ if(e.y<(a[0]+a[3]/2)) return 1; else return 2; }else return 0; } function createtmpl(e){ for(var i=0;i<12;i++){ if($("m"+i)==dragobj.o) continue var b=inner($("m"+i),e) if(b==0) continue dragobj.otemp.style.width=$("m"+i).offsetWidth if(b==1){ $("m"+i).parentNode.insertBefore(dragobj.otemp,$("m"+i)) }else{ if($("m"+i).nextSibling==null){ $("m"+i).parentNode.appendChild(dragobj.otemp) }else{ $("m"+i).parentNode.insertBefore(dragobj.otemp,$("m"+i).nextSibling) } } return } for(var j=0;j(op[1]+10)&&e.x<(op[1]+op[2]-10)){ $("dom"+j).appendChild(dragobj.otemp) dragobj.otemp.style.width=(op[2]-10)+"px" } } }dom0
dom1
dom2
dom3
dom4
dom5
dom6
dom7
dom8
dom9
dom10
dom11
收藏:魅族M8 Android内核源码和固件下载
魅族官方提供了M8的Android内核源码,包含了完整的驱动以及说明,由于MEIZU M8的物理硬件和iPhone一样平时操作的只有1个Home键无法模拟,Android的Back、Menu以及其他因素魅族放弃了M8跑Android的计划。由于M8使用的是Samsung ARM11内核的S3C6410工作频率为667MHz,山寨厂商有一定的借鉴价值。
有关魅族M8的ADB驱动 http://m8-android-kernel.googlecode.com/files/M8_6410_adb_driver.rar
M8的Android编译好固件下载,刷机方法和Wince的一致,下载后直接解压放到USB Storage的根目录 http://code.google.com/p/m8-android-kernel/source/browse/bin/m8_android.rar
M8 for Android源码托管在Google Code上面,使用SVN工具直接提取 浏览地址 http://code.google.com/p/m8-android-kernel/source/browse/#svn/trunk 需要注意的是Android开发网发现有关Modem这块代码没有,涉及到了英飞凌的机密,不过可以看到编译好的库,直接挂上即可。
SVN Checkout地址 http://m8-android-kernel.googlecode.com/svn/trunk
最后是Android123找到的有关M8的移植文章网上整理的word文档,有兴趣的网友可以DIY下,不过Android开发网表示Android和M8原始的Wince比较差距较大,个人还是建议使用完善的WinCE系统,毕竟可以直播RMVB、WinCE对于M8更适合些。
1. make menuconfig
A. 串口改成串口3输出打印信息。 (一) (root=/dev/nfs init=/init nfsroot=192.168.1.10:/nfs ip=192.168.1.100 console=ttySAC2,115200 console=ttySAC2,串口2输出,必须与下面同时修改 (二) System Type —>S3C UART to use for low-level messages—>2 值设成2,即串口2输出,必须与上面同时修改。
B. Onenand驱动支持 (一) Device Drivers —>Memory Technology Device (MTD) support —>OneNAND Device Support —> [] Verify OneNAND page writes <> OneNAND Flash device via platform device driver (二) onenand的支持 从贺超提供的linux2.6.27包drivers\mtd\onenand目录复制s3c6410.h,s3c_onenand.c,s3c_onenand.h提供对三星onenand的支持 (三) Makefile修改 drivers\mtd\onenand\Makefile文件最后添加一行:onenand-objs = s3c_onenand.o,编译s3c_onenand.o,连接进内核。 (四) 在arch\arm\mach-s3c6410\mach-smdk6410.c中 static struct platform_device pmem_gpu1_device = { .name = “android_pmem”, .id = 1, .dev = { .platform_data = &pmem_gpu1_pdata }, }; #endif 的后面添加代码: /add by liuyihui 2009-08-21/ / 添加onenand驱动支持 / / OneNAND Controller / / OneNAND flash controller / #define S3C64XX_PA_ONENAND (0x70100000) #define S3C64XX_SZ_ONENAND SZ_1M static struct resource s3c_onenand_resource[] = { [0] = { .start = S3C64XX_PA_ONENAND, .end = S3C64XX_PA_ONENAND + S3C64XX_SZ_ONENAND – 1, .flags = IORESOURCE_MEM, } }; 或者替换新的代码: arch\arm\plat-s3c64xx\devs.c, linux/arch/arm/mach-s3c6400/include/mach/map.h struct platform_device s3c_device_onenand = { .name = “onenand”, .id = -1, .num_resources = ARRAY_SIZE(s3c_onenand_resource), .resource = s3c_onenand_resource, .dev.platform_data = &s3c_nand_mtd_part_info }; /add end/ 在数组static struct platform_device smdk6410_devices[] __initdata = {的最后添加: &s3c_device_onenand /add by liuyihui 2009-08-21/ (五) 分区表修改:使userdata从0x0a000000开始 文件linux/arch/arm/plat-s3c/include/plat/partition.h中: { .name = “cache”, .offset = MTDPART_OFS_APPEND, .size = (67SZ_1M)+0x1000000,//orig:(67SZ_1M)/modified by cefanty 2009-08-21/ }, (六) 修改drivers\mtd\onenand\generic.c 复制drivers\mtd\onenand\generic.c替换掉。
C. Device Drivers —>Input device support —> [] Keyboards —> (一) 暂时去掉键盘支持,因为键盘占用了GPK14口,GPK14口在M8是USB供电开关的GPIO,拉高才能用USB
D. Device Drivers —> [] USB support —> <> USB Gadget Support —> (一) <> USB Gadget Drivers (Ethernet Gadget (with CDC Ethernet supp (二) Ethernet Gadget (with CDC Ethernet support) (三) [ ] RNDIS support (四) d.1)选择Ethernet Gadget (with CDC Ethernet supp,用于把M8模拟成网卡,实现nfs挂载系统。同时去掉RNDIS support支持,因为ubuntu下没有驱动支持。 (五) drivers\usb\gadget\s3c-udc-otg-hs.c修改为USB使用外部晶振 //writel(0x20, S3C_USBOTG_PHYCLK); /commented by liuyihui 2009-08-24/ writel(0x00, S3C_USBOTG_PHYCLK); /00:USB使用外部晶振。modified by liuyihui 2009-08-24*/
2. 驱动移植和修改
A. LCD驱动移植 i. drivers\video\Kconfig,搜索config FB_S3C_LTS222QV,在后面添加如下选项 config FB_S3C_LMS340KC01 bool “LMS340KC01” —help— TBA ii. 添加驱动:drivers\video\samsung\s3cfb_lms340kc01.c a) 复制刘奕辉开发的s3cfb_lms340kc01.c驱动到目录drivers\video\samsung\ b) 在drivers\video\samsung\Makefile文件最后添加内容: obj-$(CONFIG_FB_S3C_LMS340KC01) += s3cfb_lms340kc01.o iii. 修改drivers\video\samsung\s3cfb_fimd4x.c,在函数s3cfb_set_gpio最后注释代码,添加:
#if 0/commented by liuyihui 2009-08-24/ / module reset / if (gpio_is_valid(S3C64XX_GPN(5))) { err = gpio_request(S3C64XX_GPN(5), “GPN”);
if (err) { printk(KERN_ERR “failed to request GPN for ” “lcd reset control\n”); return err; }
gpio_direction_output(S3C64XX_GPN(5), 1); }
mdelay(100);
gpio_set_value(S3C64XX_GPN(5), 0); mdelay(10);
gpio_set_value(S3C64XX_GPN(5), 1); mdelay(10);
gpio_free(S3C64XX_GPF(15)); gpio_free(S3C64XX_GPN(5)); #endif
/add by liuyihui 2009-08-24/ / 打开M8 LCD需要用到的GPIO口 / #if 1 //M8 GPIO set hight / module reset ///LCD_nRESET_SHIFT/4*/ if (gpio_is_valid(S3C64XX_GPQ(4))) { err = gpio_request(S3C64XX_GPQ(4), “GPQ”);
if (err) { printk(KERN_ERR “failed to request GPQ for ” “lcd reset control\n”); return err; } gpio_direction_output(S3C64XX_GPQ(4), 1); } mdelay(100); gpio_free(S3C64XX_GPQ(4));
/ module reset ///LCD_nSS_SHIFT/5/ if (gpio_is_valid(S3C64XX_GPQ(5))) { err = gpio_request(S3C64XX_GPQ(5), “GPQ”);
if (err) { printk(KERN_ERR “failed to request GPQ for ” “lcd reset control\n”); return err; } gpio_direction_output(S3C64XX_GPQ(5), 0); } mdelay(100); gpio_free(S3C64XX_GPQ(5)); / module reset ///LCD_MOSI_SHIFT/7/ if (gpio_is_valid(S3C64XX_GPQ(6))) { err = gpio_request(S3C64XX_GPQ(6), “GPQ”);
if (err) { printk(KERN_ERR “failed to request GPQ for ” “lcd reset control\n”); return err; } gpio_direction_output(S3C64XX_GPQ(6), 1); } mdelay(100); gpio_free(S3C64XX_GPQ(6)); / module reset ///LCD_MOSI_SHIFT/7/ if (gpio_is_valid(S3C64XX_GPQ(7))) { err = gpio_request(S3C64XX_GPQ(7), “GPQ”);
if (err) { printk(KERN_ERR “failed to request GPQ for ” “lcd reset control\n”); return err; } gpio_direction_output(S3C64XX_GPQ(7), 1); } mdelay(100); gpio_free(S3C64XX_GPQ(7)); / module reset ///LCD_CLK_SHIFT/8/ if (gpio_is_valid(S3C64XX_GPQ(8))) { err = gpio_request(S3C64XX_GPQ(8), “GPQ”);
if (err) { printk(KERN_ERR “failed to request GPQ for ” “lcd reset control\n”); return err; } gpio_direction_output(S3C64XX_GPQ(8), 1); } mdelay(100); gpio_free(S3C64XX_GPQ(8));
#endif
return 0; } /add end/ c) iv. 修改drivers\video\samsung\s3cfb_spi.c,在函数s3cfb_set_gpio最后注释代码,添加: 在代码#elif defined(CONFIG_PLAT_S3C64XX)后面添加:
#define MEIZU_M8 #ifdef MEIZU_M8 #define S3C_FB_SPI_CLK(x) (S3C64XX_GPQ(8 + ( 4))) #define S3C_FB_SPI_MOSI(x) (S3C64XX_GPQ(7 + (4))) #define S3C_FB_SPI_CS(x) (S3C64XX_GPQ(6 + (4))) #else #define S3C_FB_SPI_CLK(x) (S3C64XX_GPC(1 + (ch 4))) #define S3C_FB_SPI_MOSI(x) (S3C64XX_GPC(2 + (ch 4))) #define S3C_FB_SPI_CS(x) (S3C64XX_GPC(3 + (ch * 4))) #endif
B. 触摸屏移植 drivers\input\touchscreen:synaptics510_i2c.c,synaptics510_i2c.h,Makefile,Kconfig C. 按键移植 覆盖如下文件:目录drivers\input\keyboard\下的:gpio_keys.c
3. Busybox在Android上的使用
To build busybox • Download the latest version of busybox from the following website. At the time of writing the latest version was v.1.13.3. http://www.busybox.net • Extract the busybox source: tar jxf busybox-1.13.3.tar.bz2 • Configure busybox by running menuconfig cd busybox-1.13.3/ make menuconfig • In menuconfig set the following options Busybox Settings –> Build Options –> Build Busybox as a static binary (no shared libs) – Enable this option by pressing “Y” Busybox Settings –> Build Options –> Cross compiler prefix – Set this option equal to “arm-none-linux-gnueabi-” Busybox Settings –> Installation Options –> Don’t use /usr – Enable this option by pressing “Y” Linux Module Utilities —> [ ] Simplified modutils 这项不能选,否则insmod 驱动模块加载会提示找不到*.ko驱动文件的路径 • Export path to where the cross-compiler is located on the host, for example: export PATH=/opt/arm/arm-2007q3/bin:$PATH • Build busybox make Installing Busybox
To install busybox in the target file-system • Create a /bin directory in the target file-system. For example: mkdir //bin • Copy the busybox binary to the /bin directory in the target file-system cp busybox //bin • Install the busybox command line tools on the target by executing the following commands: cd /bin ./busybox –install Make the Busybox shell the default shell
To make the busybox shell the default shell, edit the file “init.rc” in the target file-system as follows: • Edit the console service so that it runs the busybox shell and not the default shell by replacing: service console /system/bin/sh With: service console /bin/sh • Add the path of the busybox command line tools to the system path variable by replacing: export PATH /sbin:/system/sbin:/system/bin:/system/xbin With export PATH /bin:/sbin:/system/sbin:/system/bin:/system/xbin
Android cupcake 1.5版移植
1. 在Android挂载SD移植
cupcake 1.5版需要改写下列文件。
A. 编译mountd,并在文件系统中启动这一服务。
修改 system/core/mountd/Android.mk文件,开放最后一行
# disabled – we are using vold now instead # include $(BUILD_EXECUTABLE) 为:
# disabled – we are using vold now instead include $(BUILD_EXECUTABLE)
B. 增加 安装mountd.conf 文件
修改 system/core/rootdir/init.rc文件
释放下两行:
service mountd /system/bin/mountd socket mountd stream 0660 root mount C. 修改 system/core/rootdir/Android.mk 文件, 增加 etc/mountd.conf \,如下:
copy_from := \ etc/dbus.conf \ etc/init.goldfish.sh \ etc/mountd.conf \ etc/hosts D. 修改根文件系统的system\etc \mountd.conf文件: block_device /dev/block/mmcblk0
触摸屏全屏浏览器(可定时关机) C#2005 源代码
1、星期一至五,会按设定时间关机,你可以在出现关机提示时点取消(倒计时30秒); 2、星期六日,启动程序即提示关机,无操作则自动关机,若点取消,还会在设定的时间再一次提示关机(倒计时30秒); 3、按*号后输入密码,退出程序回到桌面; 4、参数设置:找到安装目录下的SystemConfig.xml文件,其中starturl为起始网页地址;returntime为多久无操作返回起始网页(单位:分钟);offtime为每天关机时间;exitkey为退出程序的密码; 5、软件需要.NET2.0环境,环境安装包有些大,就不上传了,请到 http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=zh-cn 下载
开源地址:http://code.google.com/p/full-screen-touch-browser/
可以通过本站下方的EMAIL与作者交流~:)
PHP webservice客户端 推送文章和附件(xsd:base64Binary)
setAttrName('aaa');
$a1->setAttrValue('aaaaa');
$a2 = new Attribute();
$a2->setAttrName('bbb');
$a2->setAttrValue('bbbbbb');
$ar[] = $a1;
$ar[] = $a2;
echo $ar[0]->getAttrName('aaa');
$Article = new Article();
$Article->setArticleContent(mb_convert_encoding('vvvvvvvvvvva.txt...
','UTF-8','GBK')); //文章正文
$Article->setArticleTitle(mb_convert_encoding("12212AAABBBABAAA".date('Ymd'),'UTF-8','GBK')); //文章题目
$Article->setAttr($ar); //文章定制属性组
$Article->setCreateTime(date('YmdHis')); //文章创立时间
$Article->setDepartment("tongjiju"); //用户部门
$Article->setDescription("description"); //文章描述
$Article->setImportant("0"); //文章级别
$Article->setKeyword("keyword"); //文章关键字
$Article->setLoginName("tongjiju"); //用户登录名
$Article->setModifyTime(date('YmdHis')); //文章修改时间
$Article->setPassword("tongjiju"); //用登录口令
$Article->setWebName(mb_convert_encoding("市政府子网站群二期 > 市统计局 > 市情简介",'UTF-8','GBK')); //网站的名称
$Article->setCommendId(0);
$client = new nusoap_client("http://221.122.*.*:7006/cmsweb/services/TransferArticle?wsdl", true);
$err = $client->getError();
if ($err) {
echo "Constructor error
". $err ."
";
}
$godata='';
//文章中存在附件 'finishMark'=>false-------------------------------------------------------------
$godata=array('article'=>$Article,'finishMark'=>false);
$result = $client->call("transferContent", $godata);
if ($client->fault) {
echo "Fault
";
print_r($result);
echo "
";
} else {
$err = $client->getError();
if ($err) {
echo "Error
" . $err . "
";
} else {
echo "Result
";
print_r($result);
echo "
";
}
}
$aid=$result['transferContentReturn'];
if ($aid){
//第一个附件 'finishMark'=>false-------------------------------------------------------------
$filepath='a.txt';
$fp=fopen($filepath, "rb");
$filedata=fread($fp, filesize($filepath));
fclose($fp);
$Appendix = new Appendix();
$Appendix->setFileContent(base64_encode($filedata));
$Appendix->setFileName('a.txt');
$Appendix->setFileType('txt');
$godataf=array('aid'=>$aid,'apd'=>$Appendix,'finishMark'=>false);
$resultf = $client->call("transferAppendix", $godataf);
echo '
';
echo "Result_f
";
print_r($resultf);
echo "
";
//最后附件 'finishMark'=>true-------------------------------------------------------------
$filepath2='tmp.jpg';
$fp2=fopen($filepath2, "rb");
$filedata2=fread($fp2, filesize($filepath2));
fclose($fp2);
$Appendix2 = new Appendix();
$Appendix2->setFileContent(base64_encode($filedata2));
$Appendix2->setFileName('tmp.jpg');
$Appendix2->setFileType('image_title');//image_title 此图片为标题图
$godataf2=array('aid'=>$aid,'apd'=>$Appendix2,'finishMark'=>true);
$resultf2 = $client->call("transferAppendix", $godataf2);
echo '
';
echo "Result_f2
";
print_r($resultf2);
echo "
";
}
?>
PDF在线阅读开发经验(FlexPaper+SWFTools+SaveAsPDFandXPS)
1、使用SaveAsPDFandXPS将office文档转换成PDF
http://www.microsoft.com/downloads/details.aspx?FamilyID=4d951911-3e7e-4ae6-b059-a2e79ed87041&displaylang=en
微软原计划让Office 2007直接支持保存为PDF格式,但引起了Adobe的不满,并被指责为垄断,最终被迫放弃,改为以插件的形式予以支持,插件大家都知道怎么回事儿,默认不装,要用你的自己找来装上。不过微软针对这件事情也做出了一个回应:发布XPS, XPS则是微软自己利用XML技术开发的新型文档格式。
该插件支持Office 2007的8个组件,包括Word、Excel、Access、PowerPoint、InfoPath、OneNote、Publisher和Visio。安装插件后,用户即可在上述组件中将相应文档存储为PDF格式或XPS格式,还可以方便地将文档保存为PDF/XPS格式的E-mail附件。
2、下载 SWFTools
SWFTools 是一组用来处理 Flash 的 swf 文件的工具包,包括:
- 合并工具 swfcombine
- 抽取工具 swfextract
- PDF/JPEG/PNG/AVI/TTF/WAV 到 SWF 的转换工具 :pdf2swf, jpeg2swf, png2swf, avi2swf, font2swf, and wav2swf|
- 文本解析工具 swfstrings
- SWF 解析器 swfdump
- SWF 读写库 rfxswflib
其中把pdf转成swf的工具就是pdf2swf了。在命令行中运行pdf2swf src.pdf des.swf一般能满足需求。而命令行参数可以通过pdf2swf -f得到:
-h , –help Print short help message and exit 打印帮助信息 -V , –version Print version info and exit 打印版本号 -o , –output file.swf Direct output to file.swf. If file.swf contains ‘13568621′ (file13568630.swf), then each page指定输出的swf文件名 -p , –pages range Convert only pages in range with range e.g. 1-20 or 1,4,6,9-11 or 指定转换的页面范围,使用的页码描述方法与打印机打印文件时候的选页一样
-P , –password password Use password for deciphering the pdf.指定打开pdf的密码 -v , –verbose Be verbose. Use more than one -v for greater effect.转换时输出详细的内容 -z , –zlib Use Flash 6 (MX) zlib compression.使用Flash 6的zlib压缩机制 -i , –ignore Allows pdf2swf to change the draw order of the pdf. This may make the generated允许程序修改pdf的绘制顺序,可能会导致结果与原来有差异 -j , –jpegquality quality Set quality of embedded jpeg pictures to quality. 0 is worst (small), 100 is best (big). (default:85)设置转换其中的jpeg图片的质量,从0到100,默认值是85。 -s , –set param=value Set a SWF encoder specific parameter. See pdf2swf -s help for more information. 设置SWF转码时候的参数,具体参数可以用pdf2swf -s help获取 -w , –samewindow When converting pdf hyperlinks, don’t make the links open a new window. 设置转换后的swf打开原pdf中的连接时使用相同的窗口 -t , –stop Insert a stop() command in each page. 在每页结尾添加一个stop()命令 -T , –flashversion num Set Flash Version in the SWF header to num. 设置SWF所使用的flash版本号 -F , –fontdir directory Add directory to the font search path. 指定字体文件所在路径 -b , –defaultviewer Link a standard viewer to the swf file. 指定默认的swf导航文件,用来翻页、放大缩小等等 -l , –defaultloader Link a standard preloader to the swf file which will be displayed while the main swf is loading. 指定默认的swf加载文件,用来显示加载进程效果 -B , –viewer filename Link viewer filename to the swf file. 指定swf导航文件,作用同-b -L , –preloader filename Link preloader filename to the swf file. 指定swf加载文件,作用同-l -q , –quiet Suppress normal messages. Use -qq to suppress warnings, also. 不打印普通信息,用-qq就不打印警告信息。 -S , –shapes Don’t use SWF Fonts, but store everything as shape. 不使用字体,所有都转为形状。 -f , –fonts Store full fonts in SWF. (Don’t reduce to used characters). 在swf中保存全部字体。 -G , –flatten Remove as many clip layers from file as possible. 在文件中尽量去除影片层,合并它们 -I , –info Don’t do actual conversion, just display a list of all pages in the PDF. 不做实际转换,仅显示PDF的信息。 -Q , –maxtime n Abort conversion after n seconds. Only available on Unix. 如果运行时间超时则退出。
3、java程序,实现上传PDF自动转换成SWF文件
//ajax方法,先解密传过来的文件名,根据判断生成SWF文件后跳转至FLASH页面
if (ajaxAction.equals("exeflash")) //把PDF成SWF
{
String fn = DecodeUtil.Decrypt(StringUtil.null2String(request.getParameter("fn")).trim()).toLowerCase();
try {
if (!"".equals(fn) && fn.indexOf("/") > -1 && fn.indexOf(".pdf") > -1) {
Map webfileupmap = (Map) Globals.SYS_UPLOAD_CONFIG.get("webfile");
String webfilepath = StringUtil.null2String(webfileupmap.get("path")).replace("\\", "\\\\");
fn = fn.substring(fn.lastIndexOf("/") + 1);//aa.pdf
webfilepath = webfilepath + fn;
File f = new File(webfilepath);
if (!f.exists()) {
return "error";
//如果PDF文件不存在则退出
}
Map webupmap = (Map) Globals.SYS_UPLOAD_CONFIG.get("web");
String webpath = StringUtil.null2String(webupmap.get("path")).replace("\\", "\\\\");
String urlpath = StringUtil.null2String(webupmap.get("urlpath"));
String wname = fn.substring(0, fn.indexOf(".")) + ".swf";
webpath = webpath + wname;
String wurl = urlpath + wname;
boolean issc = false;
File f2 = new File(webpath);
if (!f2.exists()) {
issc = true;
//如果文件不存在则生成
}
if (issc) {
String cmd = "C:\\SWFTools\\pdf2swf " + webfilepath + " -o " + webpath + " -T 9";
if (StringUtil.executeCmdFlash(cmd) == false) {
return "error";
}
System.out.println("cmd::::::" + cmd);
}
File f1 = new File(webpath);
if (f1.exists()) {
ajaxstr = DecodeUtil.Encrypt(wurl);
}
} else {
return "error";
}
} catch (Exception e) {
Globals.Logger("发生错误:" + e, 2);
}
}
注意:
String cmd = “C:\SWFTools\pdf2swf ” + webfilepath + ” -o ” + webpath + ” -T 9″;
加 “-T 9” 参数,设置输出版本为flash9,解决PDF文件只有一页,生成的swf不能播放的问题。
另外,若PDF内表格元素过多,在转换时会抛出一堆异常错误。似乎还没有好的解决办法?
//java调用cmd命令行方法
/**
* 运行可执行文件
*
* @param cmd
* @return String
*/
public static synchronized boolean executeCmdFlash(String cmd) {
try {
final Process process = Runtime.getRuntime().exec(cmd);
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
process.destroy();
}
});
InputStreamReader inputstreamreader = new InputStreamReader(process.getInputStream());
char c = (char) inputstreamreader.read();
if (c != '\uFFFF')
stdout.append(c);
while (c != '\uFFFF') {
if (!inputstreamreader.ready()) {
System.out.println(stdout);
try {
process.exitValue();
break;
}
catch (IllegalThreadStateException _ex) {
try {
Thread.sleep(100L);
}
catch (InterruptedException _ex2) {
}
}
} else {
c = (char) inputstreamreader.read();
stdout.append(c);
}
}
try {
inputstreamreader.close();
}
catch (IOException ioexception2) {
System.err.println("RunCmd : Error closing InputStream " + ioexception2);
return false;
}
} catch (Throwable e) {
e.printStackTrace();
Globals.Logger("发生错误:" + e, 2);
return false;
}
return true;
}
4、利用FlexPaper展示
FlexPaper是一个被设计用来与PDF2SWF一起使用,开源轻量级的在浏览器上显示各种文档的组件, 使在Flex中显示PDF成为可能,而这个过程并无需PDF软件环境的支持。它可以被当做Flex的库来使用。也可以通过将一些例如Word、PPT等文档转成PDF,然后实现在线浏览。
SwfFile : escape(host+"/upload/web/2010-05-24-10-21-51139.swf"),
Scale : 0.6,
ZoomTransition : "easeOut",
ZoomTime : 0.5,
ZoomInterval : 0.1,
FitPageOnLoad : false,
FitWidthOnLoad : true,
PrintEnabled : false,
FullScreenAsMaxWindow : true,
localeChain: "zh_CN" //设置为中文
};
5、演示地址
http://www.4th-games.org.cn/sis/public/info.html?doAction=scsg&bsdxid=1009&cdate=all
让电脑替你说"I IOVE YOU"
让电脑替你说"I IOVE YOU":新建一个记事本,在里面输入 CreateObject(“SAPI.SpVoice”).Speak “I love YOU” 保存扩展名为 .VBS 文件 如:我爱你.vbs 双击运行,电脑就会说 i love you 了,如果编好给心爱的人的话一定会让TA惊喜不已!
Android开发 ADT插件安装
安装Eclipse 插件(ADT) 要下载和安装ADT 插件,跟着Google 提供给开发者的步骤:
- 启动Eclipse,接着选择”Help”>”Software Updates”>”Find and Insta ll”
- 在出现的对话框中,选择”Search for new features to insta ll” 点击”New”
- 点击”New Remote Site”
- 在结果对话框中,为远程站点键入一个名称(如:Android Plugin)并键入 这个URL 作为它的URL: https://dl-ssl.google.com/android/eclipse/ 点击OK。(可能要翻哦墙哦)
- 现在你应该看到新站点加载到搜索列表中(并选中),点击”Finish”。
- 在后来搜索结果对话框中,选择”Android Plugin”>”Developer Tools”复选 框。这将会选择”Android Developer Tools”和”Android Editors”特性。 Android Editors 特性是可选的,但是推荐。 现在点击”Newt”
- 阅读许可协议,选择”Accept terms of th license agreement”, 点击”Next”
- 点击”Finish”
- ADT 插件没有被签名;总之,你可以点击”Insta ll All”接受安装
- 重启Eclipse
- 在重启后,更新你的Eclipse 配置来指向SDK 目录: a.选择”Window”>”Preferences” 来打开配置面板。(Mac OS X:”Eclipse”>”Preferences”) b.从左边面板中选择”Android” c.对于主面板中”SDK Location”,点击”Browse”并选中SDK 目录位置 d.点击”Apply”,接着点”OK”