DEV Community

Cover image for Add PDF OLE object into a Slide
Atir Tahir
Atir Tahir

Posted on

3 3

Add PDF OLE object into a Slide

See how to embed a document (e.g. PDF, Word, Spreadsheet) in a Presentation Slide.

string filePath = @"c:\sample.ppt";
string filePathEmbedded = @"c:\embedded.pdf";
string filePathOut = @"c:\output\result.ppt";

int pageNumber = 2;
OlePresentationOptions olePresentationOptions = new OlePresentationOptions(filePathEmbedded, pageNumber);
olePresentationOptions.X = 10;
olePresentationOptions.Y = 10;

using (Merger merger = new Merger(filePath))
{
    merger.ImportDocument(olePresentationOptions);
    merger.Save(filePathOut);
}
Enter fullscreen mode Exit fullscreen mode

All you have to do is to add GroupDocs.Merger for .NET API reference in your (new or existing) .NET project, pass the source PPT/PPTX file and the PDF that you want to embed to the API.

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay