中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

煙臺定制網(wǎng)站建設(shè)報價seo工具是什么意思

煙臺定制網(wǎng)站建設(shè)報價,seo工具是什么意思,門戶網(wǎng)站建設(shè)工作,做一個網(wǎng)站需要多長時間打印機是最常見的辦公設(shè)備了。一般情況下如果需要實現(xiàn)打印&#xff0c;可通過前端print.js包來完成。但是&#xff0c;如果要實現(xiàn)智能辦公打印&#xff0c;就可以使用JNI技術(shù)、封裝接口、遠程調(diào)用實現(xiàn)完成。 導包 jacob&#xff1a;Java COM Bridge <dependency><g…

打印機是最常見的辦公設(shè)備了。一般情況下如果需要實現(xiàn)打印,可通過前端print.js包來完成。但是,如果要實現(xiàn)智能辦公打印,就可以使用JNI技術(shù)、封裝接口、遠程調(diào)用實現(xiàn)完成。

導包

jacob:Java COM Bridge

<dependency><groupId>net.sf.jacob-project</groupId><artifactId>jacob</artifactId><version>1.14.3</version>
</dependency>

下載:jacob-1.18-x64.dll

接口開發(fā)

service

/*** @Author lyonardo* @Description 打印* @Date 16:20 2020/1/20* @Param [filePath, startMsg, endMsg, cause, departId]* @return com.xxx.basic.response.ReturnData**/@Overridepublic ReturnData excelPrint(String filePath, Long startMsg, Long endMsg, String cause, Integer departId) {try {//下載驅(qū)動FileUtil.saveUrlAs(fileServerPath+"/file/", "jacob-1.18-x64.dll", "C:/Windows/System32", "GET");String excelName = "xx市中級人民法院辦理減刑案件情況統(tǒng)計表";String outFilename = buildOutFilename(excelName,startMsg,endMsg);//判斷文件是否已經(jīng)生成String excelDownloadPath = "";if(FileUtils.directoryContains(new File("/rpcs/excel"), new File("/rpcs/excel/download"+"/"+outFilename))){excelDownloadPath = "/rpcs/excel/download"+"/"+outFilename;}else{CaseStatVo caseStatVo = getCaseStatVo(startMsg, endMsg, cause, departId);ExportUtils.excelWrite(fileServerPath, caseStatVo, filePath,outFilename, JodaTimeUtil.formatDate2ToString(startMsg, endMsg));excelDownloadPath = "/rpcs/excel/download"+"/"+outFilename;}//打印指定文件名文件Integer i = PrintUtil.printOfficeFile(excelDownloadPath);if (1 == i) return ReturnData.operateSuncess();} catch (IOException e) {e.printStackTrace();}return ReturnData.operateFail();}

PrintUtil封裝

/*** @Author lyonardo* @Description Office打印* @Date 14:49 2019/9/23* @Param [filePath 文件路徑]* @return boolean
**/
public static Integer printOfficeFile(String filePath) {String postfixString = FileUtil.getFilePathExtensions(filePath);if (postfixString.equalsIgnoreCase("xls")|| postfixString.equalsIgnoreCase("xlsx")) {/*** 功能:實現(xiàn)excel打印工作*/ComThread.InitSTA();ActiveXComponent xl = new ActiveXComponent("Excel.Application");try {// System.out.println("version=" +// xl.getProperty("Version"));// 不打開文檔Dispatch.put(xl, "Visible", new Variant(false));Dispatch workbooks = xl.getProperty("Workbooks").toDispatch();// 打開文檔Dispatch excel = Dispatch.call(workbooks, "Open",filePath).toDispatch();// 橫向打印//     Dispatch currentSheet = Dispatch.get(excel, "ActiveSheet")//       .toDispatch();//     Dispatch pageSetup = Dispatch//       .get(currentSheet, "PageSetup").toDispatch();//     Dispatch.put(pageSetup, "Orientation", new Variant(2));//每張表都橫向打印Dispatch sheets = Dispatch.get(excel, "Sheets").toDispatch();// 獲得幾個sheetint count = Dispatch.get(sheets, "Count").getInt();//     System.out.println(count);for (int j = 1; j <=count; j++) {Dispatch sheet = Dispatch.invoke(sheets, "Item",Dispatch.Get, new Object[] { new Integer(j) },new int[1]).toDispatch();Dispatch pageSetup = Dispatch.get(sheet, "PageSetup").toDispatch();Dispatch.put(pageSetup, "Orientation", new Variant(2));Dispatch.call(sheet, "PrintOut");}// 開始打印if (excel != null) {//Dispatch.call(excel, "PrintOut");//增加以下三行代碼解決文件無法刪除bugDispatch.call(excel, "save");Dispatch.call(excel,  "Close" ,  new  Variant(true));excel=null;}xl.invoke("Quit", new Variant[] {});xl=null;return 1;} catch (Exception e) {e.printStackTrace();return 0;} finally {// 始終釋放資源ComThread.Release();}}else if (postfixString.equalsIgnoreCase("doc")|| postfixString.equalsIgnoreCase("docx")) {ComThread.InitSTA();ActiveXComponent wd = new ActiveXComponent("Word.Application");try {// 不打開文檔Dispatch.put(wd, "Visible", new Variant(false));Dispatch document = wd.getProperty("Documents").toDispatch();// 打開文檔Dispatch doc = Dispatch.invoke(document, "Open",Dispatch.Method, new Object[] { filePath },new int[1]).toDispatch();// 開始打印if (doc != null) {Dispatch.call(doc, "PrintOut");Dispatch.call(doc, "save");Dispatch.call(doc,  "Close" ,  new  Variant(true));doc=null;}wd.invoke("Quit", new Variant[] {});wd=null;return 1;} catch (Exception e) {e.printStackTrace();return 0;} finally {// 始終釋放資源ComThread.Release();}}else {return 0;}
}

測試

  @Testpublic void test(){String filePath  = "C:/Users/Administrator/Desktop/xx市中級人民法院辦理減刑案件情況統(tǒng)計表.xlsx";//String printerName = "FX DocuPrint M115 b";//打印機名包含字串PrintUtil.printOfficeFile(filePath);}
http://www.risenshineclean.com/news/1987.html

相關(guān)文章:

  • 國示范校建設(shè)網(wǎng)站品牌廣告語經(jīng)典100條
  • 網(wǎng)站后綴twnba最新消息球員交易
  • 網(wǎng)站建設(shè)的業(yè)務范圍手游推廣個人合作平臺
  • 在網(wǎng)站上做網(wǎng)絡(luò)課堂軟件多少錢線上營銷推廣方案
  • 網(wǎng)站建設(shè) 資質(zhì)昆明網(wǎng)絡(luò)推廣
  • 動態(tài)html做網(wǎng)站背景離我最近的廣告公司
  • 收費搭建網(wǎng)站多地優(yōu)化完善疫情防控措施
  • 做網(wǎng)站后期維護工資貼吧西安百度推廣外包
  • 網(wǎng)站建設(shè)內(nèi)部流程圖營銷策略有哪些
  • 合肥網(wǎng)站建設(shè)推廣百度網(wǎng)站大全舊版
  • 十堰網(wǎng)站設(shè)計營銷團隊公司
  • 百度網(wǎng)站排名優(yōu)化軟件蘇州網(wǎng)站關(guān)鍵詞優(yōu)化推廣
  • 廣饒網(wǎng)站建設(shè)優(yōu)化設(shè)計七年級上冊數(shù)學答案
  • tlbb3官方網(wǎng)站慕容神器做的步驟網(wǎng)絡(luò)新聞發(fā)布平臺
  • 網(wǎng)站開發(fā)php和c語言區(qū)別seo優(yōu)化工作有哪些
  • 小微網(wǎng)站建設(shè)接單平臺上海知名網(wǎng)站制作公司
  • 如何做微信個人網(wǎng)站seo咨詢服務
  • 廣州網(wǎng)站設(shè)計制作公司抖音seo推廣
  • 如何建設(shè)自己的淘寶客網(wǎng)站2022年度最火關(guān)鍵詞
  • 做淘寶優(yōu)惠券推廣網(wǎng)站搜索數(shù)據(jù)
  • 凡科網(wǎng)站可以做seo優(yōu)化推廣軟件下載
  • 現(xiàn)在的網(wǎng)站開發(fā)用什么技術(shù)免費域名申請網(wǎng)站大全
  • 佛山營銷型網(wǎng)站建設(shè)上海網(wǎng)站建設(shè)咨詢
  • 中山三水網(wǎng)站建設(shè)網(wǎng)站推廣策劃書模板
  • 東陽網(wǎng)站建設(shè)安卓優(yōu)化大師官方下載
  • 如題,HTML如何將兩張圖片_一張放在網(wǎng)站頂部做背景,另一張放在尾部做背景?項目推廣渠道有哪些
  • 網(wǎng)站建設(shè)人員百度指數(shù)數(shù)據(jù)官網(wǎng)
  • 凡科網(wǎng)登錄官網(wǎng)seo關(guān)鍵詞排名優(yōu)化哪家好
  • 墊江網(wǎng)站開發(fā)djrckj百度云網(wǎng)盤搜索引擎入口
  • 做棋牌游戲網(wǎng)站賺錢嗎百度網(wǎng)頁游戲