Я пытаюсь преобразовать файл pptx в изображение, а затем создать из него PDF-файл, используя apache poi и iText.
Dimension pgsize = ppt.getPageSize();
XSLFSlide slide = ppt.getSlides()[0];
PdfWriter pdfWriter = null;
Document document = new Document()
pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(targetPath));
document.setPageSize(new Rectangle((float) pgsize.getWidth(), (float) pgsize.getHeight()));
document.open();
PdfGraphics2D graphics = (PdfGraphics2D) pdfWriter.getDirectContent().createGraphics((float) pgsize.getWidth(),
(float) pgsize.getHeight());
slide.draw(graphics);
graphics.dispose();
document.close();
Но я получаю сообщение об ошибке:
java.lang.AbstractMethodError: org.apache.poi.xslf.usermodel.XSLFTextRun.getFontInfo(Lorg/apache/poi/common/usermodel/fonts/FontGroup;)Lorg/apache/poi/common/usermodel/fonts/FontInfo;
at org.apache.poi.sl.draw.DrawTextParagraph.getAttributedString(DrawTextParagraph.java:584) ~[poi-3.17.jar:3.17]
at org.apache.poi.sl.draw.DrawTextParagraph.breakText(DrawTextParagraph.java:259) ~[poi-3.17.jar:3.17]
at org.apache.poi.sl.draw.DrawTextShape.drawParagraphs(DrawTextShape.java:156) ~[poi-3.17.jar:3.17]
at org.apache.poi.sl.draw.DrawTextShape.drawContent(DrawTextShape.java:125) ~[poi-3.17.jar:3.17]
at org.apache.poi.sl.draw.DrawSimpleShape.draw(DrawSimpleShape.java:97) ~[poi-3.17.jar:3.17]
at org.apache.poi.sl.draw.DrawSheet.draw(DrawSheet.java:71) ~[poi-3.17.jar:3.17]
at org.apache.poi.sl.draw.DrawSlide.draw(DrawSlide.java:41) ~[poi-3.17.jar:3.17]
at org.apache.poi.xslf.usermodel.XSLFSlide.draw(XSLFSlide.java:307) ~[tika-server-1.16.jar:1.16]