PDF veya HTML'den JavaScript ile Sunumları İçe Aktarma
Contents
[
Hide
]
Giriş
Using Aspose.Slides for Node.js via 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.
PDF’ten PowerPoint’e Aktarım
Bu durumda, bir PDF’yi PowerPoint sunumuna dönüştürebilirsiniz.

- Bir Presentation sınıfının örneğini oluşturun.
- PDF dosyasını geçerek addFromPdf() metodunu çağırın.
- Dosyayı PowerPoint formatında kaydetmek için save() metodunu kullanın.
Bu JavaScript kodu PDF’ten PowerPoint’e dönüşüm işlemini gösterir:
var pres = new aspose.slides.Presentation();
try {
pres.getSlides().addFromPdf("InputPDF.pdf");
pres.save("OutputPresentation.pptx", aspose.slides.SaveFormat.Pptx);
} finally {
if (pres != null) {
pres.dispose();
}
}
Tip
Burada açıklanan sürecin canlı bir uygulaması olduğu için Aspose free PDF to PowerPoint web uygulamasına göz atmak isteyebilirsiniz.HTML’den PowerPoint’e Aktarım
Bu durumda, bir HTML belgesini PowerPoint sunumuna dönüştürebilirsiniz.
- Bir Presentation sınıfının örneğini oluşturun.
- HTML dosyasını geçerek addFromHtml() metodunu çağırın.
- Dosyayı PowerPoint formatında kaydetmek için save() metodunu kullanın.
Bu JavaScript kodu HTML’den PowerPoint’e dönüşüm işlemini gösterir:
var presentation = new aspose.slides.Presentation();
try {
var htmlStream = java.newInstanceSync("java.io.FileInputStream", "page.html");
try {
presentation.getSlides().addFromHtml(htmlStream);
} finally {
if (htmlStream != null) {
htmlStream.close();
}
}
presentation.save("MyPresentation.pptx", aspose.slides.SaveFormat.Pptx);
} catch (e) {
console.log(e);
} finally {
if (presentation != null) {
presentation.dispose();
}
}
SSS
PDF içe aktarılırken tablolar korunur mu ve algılamaları iyileştirilebilir mi?
Tablolar içe aktarma sırasında algılanabilir; PdfImportOptions içinde tablo tanımasını etkinleştiren bir setDetectTables metodu bulunur. Etkinlik, PDF’nin yapısına bağlıdır.