AddFromPdf

AddFromPdf(string)

从 PDF 文档创建幻灯片并将其添加到集合的末尾。

public ISlide[] AddFromPdf(string path)
参数类型描述
pathStringPDF 文档的路径

返回值

已添加的幻灯片

示例

示例:

[C#]
using (Presentation pres = new Presentation())
{
    pres.Slides.AddFromPdf("document.pdf");
    pres.Save("fromPdfDocument.pptx", SaveFormat.Pptx);
}

另见


AddFromPdf(string, PdfImportOptions)

从 PDF 文档创建幻灯片并将其添加到集合的末尾,考虑 PDF 导入选项。

public ISlide[] AddFromPdf(string path, PdfImportOptions pdfImportOptions)
参数类型描述
pathStringPDF 文档的路径
pdfImportOptionsPdfImportOptionsPDF 导入选项

返回值

已添加的幻灯片

示例

示例:

[C#]
using (Presentation pres = new Presentation())
{
    pres.Slides.AddFromPdf("document.pdf", new PdfImportOptions { DetectTables = true });
    pres.Save("fromPdfDocument.pptx", SaveFormat.Pptx);
}

另见


AddFromPdf(Stream, PdfImportOptions)

从 PDF 文档创建幻灯片并将其添加到集合的末尾。

public ISlide[] AddFromPdf(Stream pdfStream, PdfImportOptions pdfImportOptions)
参数类型描述
pdfStreamStream将用作 PDF 文档源的流
pdfImportOptionsPdfImportOptionsPDF 导入选项

返回值

已添加的幻灯片

示例

示例:

[C#]
using (Presentation pres = new Presentation())
{
    using (Stream stream = new FileStream("document.pdf", FileMode.Open, FileAccess.Read, FileShare.Read))
    {
        pres.Slides.AddFromPdf(stream, new PdfImportOptions { DetectTables = true });
    }
    
    pres.Save("fromPdfDocument.pptx", SaveFormat.Pptx);
}

另见


AddFromPdf(Stream)

从 PDF 文档创建幻灯片并将其添加到集合的末尾。

public ISlide[] AddFromPdf(Stream pdfStream)
参数类型描述
pdfStreamStream将用作 PDF 文档源的流

返回值

已添加的幻灯片

示例

示例:

[C#]
using (Presentation pres = new Presentation())
{
    using (Stream stream = new FileStream("document.pdf", FileMode.Open, FileAccess.Read, FileShare.Read))
    {
        pres.Slides.AddFromPdf(stream);
    }
    
    pres.Save("fromPdfDocument.pptx", SaveFormat.Pptx);
}

另见