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)

从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);
}

另见


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);
}

另见