日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

【JAVA】java代码实现print2Flash转swf文件,百度文库一样。

發(fā)布時(shí)間:2023/12/31 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【JAVA】java代码实现print2Flash转swf文件,百度文库一样。 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

以前用的flashpapger但是很 遺憾不支持64位機(jī)子。

改用print2Flash。

java代碼如下:

import java.io.*;import com.jacob.activeX.*; import com.jacob.com.*;public class TestPrint2Flash {public static void main(String[] args) throws java.io.IOException {getswf("D:\\aa.doc");}public static void getswf(String args) throws IOException {if (args.length() > 0) {try {ComThread.InitSTA();// Create Server objectActiveXComponent p2f = new ActiveXComponent("Print2Flash3.Server");// Setup interface and protection optionsActiveXComponent defProfile = new ActiveXComponent(p2f.getProperty("DefaultProfile").toDispatch());defProfile.setProperty("InterfaceOptions", P2FConst.INTDRAG| P2FConst.INTSELTEXT | P2FConst.INTZOOMSLIDER| P2FConst.INTZOOMBOX | P2FConst.INTFITWIDTH| P2FConst.INTFITPAGE | P2FConst.INTPREVPAGE| P2FConst.INTGOTOPAGE | P2FConst.INTNEXTPAGE| P2FConst.INTSEARCHBOX | P2FConst.INTSEARCHBUT| P2FConst.INTPRINT | P2FConst.INTNEWWIND| P2FConst.INTFULLSCREEN | P2FConst.INTFULLSCREENAUTO);// defProfile.setProperty("ProtectionOptions",// P2FConst.PROTDISPRINT | P2FConst.PROTENAPI);// Convert documentSystem.out.println(args);//p2f.invoke("ConvertFile", new String(args));System.out.println("swf轉(zhuǎn)換成功...");} catch (Exception e) {System.out.println("swf轉(zhuǎn)換失敗: " + e.toString());} finally {ComThread.Release();}} elseSystem.out.println("轉(zhuǎn)swf出錯(cuò)。。。。");} }
public class P2FConst {// APPLICATIONTYPE enumeration constantspublic static final int MSEXCEL = 0x00000001;public static final int MSWORD = 0x00000002;public static final int MSPOWERPOINT = 0x00000004;public static final int ACROBAT = 0x00000008;// IMAGEFORMAT enumeration constantspublic static final int JPEG = 1;public static final int PNG = 2;// IMGBEHAVIOR enumeration constantspublic static final int STRETCH = 1;public static final int TILE = 2;// INTERFACE_OPTION enumeration constantspublic static final int INTLOGO = 0x00000001; //系統(tǒng)logopublic static final int INTDRAG = 0x00000002; //拖動(dòng)按鈕public static final int INTSELTEXT = 0x00000004; //選擇“文本”按鈕public static final int INTZOOMSLIDER = 0x00000008; //縮放滑塊public static final int INTZOOMBOX = 0x00000010;//縮放框public static final int INTFITWIDTH = 0x00000020;//“適合寬度”按鈕public static final int INTFITPAGE = 0x00000040;//適合頁面按鈕public static final int INTPREVPAGE = 0x00000080;//上一頁按鈕public static final int INTGOTOPAGE = 0x00000100;//轉(zhuǎn)到頁框public static final int INTNEXTPAGE = 0x00000200;//“下一頁”按鈕public static final int INTSEARCHBOX = 0x00000400;//搜索框public static final int INTSEARCHBUT = 0x00000800;//“搜索”按鈕public static final int INTROTATE = 0x00001000;//旋轉(zhuǎn)按鈕public static final int INTPRINT = 0x00002000;//“打印”按鈕public static final int INTNEWWIND = 0x00004000;//打開新窗口“按鈕public static final int INTHELP = 0x00008000;//幫助按鈕public static final int INTBACKBUTTON = 0x00030000;//總是顯示后退按鈕public static final int INTBACKBUTTONAUTO = 0x00010000;//顯示后退按鈕只有內(nèi)部鏈接在文檔中存在public static final int INTFORWARDBUTTON = 0x000C0000;//總是顯示“前進(jìn)”按鈕public static final int INTFORWARDBUTTONAUTO = 0x00040000;//正向顯示按鈕只有內(nèi)部鏈接在文檔中存在public static final int INTFULLSCREEN = 0x00300000;//總是顯示“全屏”按鈕public static final int INTFULLSCREENAUTO = 0x00100000;//如果它可以檢測(cè)Flash播放器不支持或允許使用全屏幕模式,隱藏的全屏按鈕。否則,顯示“全屏”按鈕。// METADATAPORMAT enumeration constantspublic static final int XML = 1;public static final int TEXT = 2;// OUTPUTFORMAT enumeration constantspublic static final int SINGLEFILE = 1;public static final int SINGLEFILEPERPAGE = 2;public static final int EXTVIEWER = 4;// PAPER_ORIENTATION enumeration constantspublic static final int ORIENT_PORTRAIT = 1;public static final int ORIENT_LANDSCAPE = 2;// PROTECTION_OPTION enumeration constantspublic static final int PROTDISPRINT = 0x00000001;//禁用文檔打印public static final int PROTDISTEXTCOPY = 0x00000002;//禁止復(fù)制文本的文檔由用戶public static final int PROTENAPI = 0x00000004;//啟用Print2Flash文件API支持(從Flash使用Print2Flash文件API的是只有部分禁用)// ThreeStateFlag enumeration constantspublic static final int TSF_NO = 0;public static final int TSF_YES = 1;public static final int TSF_AUTO = 2;// TOOLBARIMAGE enumeration constantspublic static final int IMGLOGO = 1;public static final int IMGDRAG = 2;public static final int IMGSELTEXT = 3;public static final int IMGZOOMRULER = 4;public static final int IMGZOOMFOCUSNADLE = 5;public static final int IMGZOOMNADLE = 6;public static final int IMGFITWIDTH = 7;public static final int IMGFITPAGE = 8;public static final int IMGPREVPAGE = 9;public static final int IMGNEXTPAGE = 10;public static final int IMGSEARCHBUT = 11;public static final int IMGROTATE = 12;public static final int IMGPRINT = 13;public static final int IMGNEWWIND = 14;public static final int IMGHELP = 15;public static final int IMGMORE = 16;public static final int IMGTOOLBARBGR = 17;public static final int IMGBACK = 18;public static final int IMGFORWARD = 19;public static final int IMGFULLSCREEN = 20;public static final int IMGEXITFULLSCREEN = 21;// TEMPLATETYPE enumeration constantspublic static final int TEMPLATE_CUSTOM = 1;public static final int TEMPLATE_ACTIONSCRIPT2 = 2;public static final int TEMPLATE_ACTIONSCRIPT3 = 3;// WATERMARKANCHOR enumeration constantspublic static final int CENTER = 0;public static final int LEFTCENTER = 1;public static final int RIGHTCENTER = 2;public static final int TOPCENTER = 16;public static final int BOTTOMCENTER = 32;public static final int LEFTTOP = 17;public static final int RIGHTTOP = 18;public static final int LEFTBOTTOM = 33;public static final int RIGHTBOTTOM = 34;// COMPRESSION_METHOD enumeration constantspublic static final int COMPRESSION_METHOD_ZLIB = 0;public static final int COMPRESSION_METHOD_LZMA = 1; }
例子完整路徑下載: http://download.csdn.net/detail/hateson/5844699

總結(jié)

以上是生活随笔為你收集整理的【JAVA】java代码实现print2Flash转swf文件,百度文库一样。的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。