利用pdf2swf将PDF转换成SWF
将PDF转换成SWF可以使用SWFTools工具中的pdf2swf(http://www.swftools.org/), 1、首先下载安装,一直默认下一步即可。 public class TestPdf2Swf { // 源文件不存在则返回 File source = new File(sourcePath); if (!source.exists()) return 0; // 调用pdf2swf命令进行转换 String command = "C:SWFToolspdf2swf.exe" + " " + sourcePath+ " -o " + destPath + fileName + " -f -T 9"; System.out.println(command); Process pro = Runtime.getRuntime().exec(command); BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(pro.getInputStream())); while (bufferedReader.readLine() != null); try { pro.waitFor(); } catch (InterruptedException e) { e.printStackTrace(); } return pro.exitValue(); } /** * @param args */ public static void main(String[] args) { String sourcePath = "D:springFramework.pdf"; //源文件路径 String destPath = "D:"; //目标路径 String fileName = "springFramework.swf"; //生成文件名 try { TestPdf2Swf.convertPDF2SWF(sourcePath,destPath,fileName); } catch (IOException e) { e.printStackTrace(); } } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |