นำเข้าการนำเสนอจาก PDF หรือ HTML บน Android
Contents
[
Hide
]
บทนำ
Using Aspose.Slides สำหรับ Android ผ่าน Java, you can import presentations from files in other formats. Aspose.Slides provides the SlideCollection class to allow you to import presentations from PDFs, HTML documents, etc.
นำเข้า PowerPoint จาก PDF
ในกรณีนี้ คุณจะทำการแปลงไฟล์ PDF เป็นงานนำเสนอ PowerPoint

- สร้างอินสแตนซ์ของคลาส Presentation .
- เรียกใช้เมธอด addFromPdf() และส่งไฟล์ PDF .
- ใช้เมธอด save() เพื่อบันทึกไฟล์ในรูปแบบ PowerPoint .
This Java code demonstrates the PDF to PowerPoint operation:
Presentation pres = new Presentation();
try {
pres.getSlides().addFromPdf("InputPDF.pdf");
pres.save("OutputPresentation.pptx", SaveFormat.Pptx);
} finally {
if (pres != null) pres.dispose();
}
Tip
คุณอาจต้องการตรวจสอบเว็บแอป Aspose free PDF to PowerPoint เนื่องจากเป็นการทำงานแบบสดของกระบวนการที่อธิบายไว้ที่นี่.นำเข้า PowerPoint จาก HTML
ในกรณีนี้ คุณจะทำการแปลงเอกสาร HTML เป็นงานนำเสนอ PowerPoint.
- สร้างอินสแตนซ์ของคลาส Presentation .
- เรียกใช้เมธอด addFromHtml() และส่งไฟล์ HTML .
- ใช้เมธอด save() เพื่อบันทึกไฟล์ในรูปแบบ PowerPoint .
This Java code demonstrates the HTML to PowerPoint operation:
Presentation presentation = new Presentation();
try {
FileInputStream htmlStream = new FileInputStream("page.html");
try {
presentation.getSlides().addFromHtml(htmlStream);
} finally {
if (htmlStream != null) htmlStream.close();
}
presentation.save("MyPresentation.pptx", SaveFormat.Pptx);
} catch(IOException e) {
} finally {
if (presentation != null) presentation.dispose();
}
คำถามที่พบบ่อย
ตารางจะถูกคงไว้เมื่อทำการนำเข้า PDF หรือไม่ และการตรวจจับสามารถปรับปรุงได้หรือไม่?
ตารางสามารถตรวจจับได้ระหว่างการนำเข้า; PdfImportOptions มีเมธอด setDetectTables ที่เปิดใช้งานการรู้จำตาราง. ประสิทธิภาพขึ้นอยู่กับโครงสร้างของ PDF.