使用 Apache POI 库并在要转换的方法中编写此代码
FileInputStream is = new FileInputStream("PPT file");
SlideShow ppt = new SlideShow(is);
is.close();
final Dimension pgsize = ppt.getPageSize();
final Slide[] slide = ppt.getSlides();
int i = 1;// Slide number
String title = slide[i].getTitle();
Bitmap bmp = Bitmap.createBitmap((int) pgsize.getWidth(),
(int) pgsize.getHeight(), Config.RGB_565);
Canvas canvas = new Canvas(bmp);
Paint paint = new Paint();
paint.setColor(android.graphics.Color.WHITE);
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
canvas.drawPaint(paint);
Graphics2D graphics2d = new Graphics2D(canvas);
// render
slide[i].draw(graphics2d);
bmp.compress(CompressFormat.JPEG, 80, new FileOutputStream("Path to your file"));