更新时间:2022-05-30 01:08:24
public @ResponseBody FileBlob downloadSWFTempAllUseOpenOffice() throws Exception { System.out.println("--------------程序执行到此处------------------"); String[] bookMarks = new String[] { "DealerName", "Name", "CgName", "TypeName", "OrderQty", "CoolCode", "ChassisCode", "CustPrice", "CustAmt", "sumall", "EarnestPayDays", "EarnestAmt", "StageDate", "FirstAmt", "DepositPercent", "Deposit", "ServiceChargePercent", "ServiceCharge", "NotarizationFee", "InsuranceTerm", "Insurance", "ReinsuranceDeposit", "FinanceAmt", "FinanceFC", "LackAmtPayDate", "LackAmtFinalPayDate", "ReceiverName", "ReceiverID", "ReceiverTel", "Insurer","authoriate" }; String[] mapValue = new String[] { "工程机械有限公司", "工程机械有限公司", "六桥车", "xxx52E(6)", "2", "风冷", "V09660ffff", "300.00", "600.00", "陆万元整", "7", "100", "2000年8月31日", "60", "5", "3", "10", "6", "10", "5", "10", "21", "540", "10", "2000年8月31日", "2000年8月31日", "xxx", "430111199910102121", "13800138200", "xxxxx","bboss" }; String hetongbianhao = "20121222"; String wordtemplate = "/opt/tomcat/wordpdf/anjie.doc"; String pdfpath = "/opt/tomcat/test/anjieswftools_" + hetongbianhao + ".pdf"; String wordfile = "/opt/tomcat/test/anjie_testswftools" + hetongbianhao + ".doc"; String toswfpath = "/opt/tomcat/test/contractswftools_" + hetongbianhao + ".swf"; String officeHome = "/opt/LibreOffice 3.6/"; File f = new File(toswfpath); if(!f.exists()) { FileConvertor.init( officeHome); FileConvertor.getRealWordByOpenoffice(wordtemplate, wordfile,bookMarks, bookdatas); FileConvertor.wordToPDFByOpenOffice(wordfile, pdfpath); FileConvertor.swftoolsConvert(swftoolWorkDir, pdfpath, toswfpath); } FileBlob fileblob = new FileBlob(toswfpath,FileBlob.DOWNLOAD); return fileblob; }
public @ResponseBody FileBlob getSWFTemp() throws Exception { System.out.println("--------------程序执行到此处------------------"); String[] bookMarks = new String[] { "DealerName", "Name", "CgName", "TypeName", "OrderQty", "CoolCode", "ChassisCode", "CustPrice", "CustAmt", "sumall", "EarnestPayDays", "EarnestAmt", "StageDate", "FirstAmt", "DepositPercent", "Deposit", "ServiceChargePercent", "ServiceCharge", "NotarizationFee", "InsuranceTerm", "Insurance", "ReinsuranceDeposit", "FinanceAmt", "FinanceFC", "LackAmtPayDate", "LackAmtFinalPayDate", "ReceiverName", "ReceiverID", "ReceiverTel", "Insurer","authoriate" }; String[] mapValue = new String[] { "工程机械有限公司", "工程机械有限公司", "六桥车", "xxx", "2", "风冷", "V09660", "300.00", "600.00", "陆万元整", "7", "100", "2000年8月31日", "60", "5", "3", "10", "6", "10", "5", "10", "21", "540", "10", "2000年8月31日", "2000年8月31日", "xxx", "430111199910102121", "13800138200", "xxx","bboss" }; String hetongbianhao = "20121222"; String wordtemplate = "/opt/tomcat/wordpdf/anjie.doc"; String pdfpath = "/opt/tomcat/test/anjieswftools_" + hetongbianhao + ".pdf"; String wordfile = "/opt/tomcat/test/anjie_testswftools" + hetongbianhao + ".doc"; String toswfpath = "/opt/tomcat/test/contractswftools_" + hetongbianhao + ".swf"; String officeHome = "/opt/LibreOffice 3.6/"; File f = new File(toswfpath); if(!f.exists()) { FileConvertor.init( officeHome); FileConvertor.getRealWordByOpenoffice(wordtemplate, wordfile,bookMarks, bookdatas); FileConvertor.wordToPDFByOpenOffice(wordfile, pdfpath); FileConvertor.swftoolsConvert(swftoolWorkDir, pdfpath, toswfpath); } FileBlob fileblob = new FileBlob(toswfpath,FileBlob.BROWSER); return fileblob; }
<%@ page contentType="text/html; charset=utf-8"%> <html> <head> <title></title> </head> <body marginwidth="0" marginheight="0"> <embed height="100%" width="100%" name="plugin" src="getSWFTemp.page" type="application/x-shockwave-flash"> </body> </html>