- ·上一篇:线上答辩的ppt怎么做
- ·下一篇:怎么给ppt手机配音
怎么提取手机里的ppt
2025-01-09 09:23:23
1.android如何读取word
Android中读取word文件需要用第三方jar包tm-extractors-0.4.jar,读取很简单,直接看下面安卓读取word文件的核心代码: public class WordReader extends Activity { /** Called when the activity is first created. */ private TextView tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); tv = (TextView) findViewById(R.id.text); String str = readWord(Environment.().getAbsolutePath() + "/test.doc"); tv.setText(str.trim().replace("\r", "")); } public String readWord(String file){ //创建输入流读取word文件 FileInputStream in = new FileInputStream(new File(file)); WordExtractor extractor = null; //创建WordExtractor extractor = new WordExtractor(); //获取word文件内容 String text = extractor.extractText(in); return text; } }。