Skip to content

Spire.Presentation for C++ is an independent PowerPoint® compatible API that enables developers to create, read, write, modify, and convert PowerPoint documents on any C++ platforms.

Notifications You must be signed in to change notification settings

eiceblue/Spire.Presentation-for-C-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

Spire.Presentation for C++ - A C++ Library for Processing PowerPoint Documents

Foo

Product Page | Forum | Temporary License | Customized Demo

Spire.Presentation for C++ is a professional PowerPoint C++ API that enables developers to create, read, write, modify, and convert PowerPoint documents on any C++ platforms without installing Microsoft PowerPoint.

This API supports PPT, PPS, PPTX and PPSX presentation formats. It provides functions such as managing text, image, shapes, tables, animations, audio, and video on slides and supports exporting presentation slides to JPG, PDF, XPS, SVG, HTML and other formats.

100% Standalone C++ API

Spire.Presentation for C++ is a totally independent C++ PowerPoint API which doesn't require Microsoft PowerPoint to be installed on system.

Freely Operate PowerPoint Files

  • Create/Save/Merge/Split PowerPoint Document.
  • Protect/Unprotect PowerPoint Document.
  • Create/Add/Delete/Hide/Show/Move slides.
  • Add/Remove/Extract/Replace comments and notes in PowerPoint.
  • Add/Remove/Revise/Extract/Replace texts and images in PowerPoint.
  • Work with charts, tables and SmartArt in PowerPoint.
  • Insert/Modify/Remove hyperlinks.
  • Add/Remove text and image watermark.
  • Insert/Replace/Extract Audio and Video.

Powerful & High Quality PowerPoint File Conversion

  • Convert PowerPoint to HTML
  • Convert PowerPoint to XPS
  • Convert PowerPoint to SVG
  • Convert PowerPoint to PDF
  • Convert PowerPoint to PPTX
  • Convert PowerPoint to Image/Image to PowerPoint

Examples

Encrypt PowerPoint in C++

#include "pch.h"

using namespace std;
using namespace Spire::Presentation;

int main()
{
	std::wstring inputFile = DataPath"Encrypt.pptx";
	std::wstring outputFile = OutputPath"Encrypt.pptx";

	//Create a PPT document
	Presentation* presentation = new Presentation();

	//Load the document from disk
	presentation->LoadFromFile(inputFile.c_str());

	//Get the password that the user entered
	std::wstring password = L"e-iceblue";

	//Encrypy the document with the password
	presentation->Encrypt(password.c_str());

	//Save the document
	presentation->SaveToFile(outputFile.c_str(), FileFormat::Pptx2010);
	delete presentation;

}

Convert PowerPoint to PDF in C++

#include "pch.h"

using namespace std;
using namespace Spire::Presentation;

int main()
{
	std::wstring inputFile = DataPath"ToPDF.pptx";
	std::wstring outputFile = OutputPath"ToPDF.pdf";

	//Create a PPT document
	Presentation* ppt = new Presentation();
	//Load the file from disk.
	ppt->LoadFromFile(inputFile.c_str());

	//Save the document to PDF format
	ppt->SaveToFile(outputFile.c_str(), FileFormat::PDF);

	delete ppt;
}

Convert PowerPoint to Images in C++

#include "pch.h"

using namespace std;
using namespace Spire::Presentation;

int main()
{
	std::wstring inputFile = DataPath"ToImage.pptx";
	std::wstring outputFile = OutputPath"Image/ToImage/";

	//Create a PPT document
	Presentation* ppt = new Presentation();
	//Load the file from disk.
	ppt->LoadFromFile(inputFile.c_str());

	//Save PPT document to images
	SlideCollection* slides = ppt->GetSlides();
	for (int i = 0; i < slides->GetCount(); i++)
	{
		ISlide* slide = slides->GetItem(i);
		Stream* image = slide->SaveAsImage();
		image->Save((outputFile + L"ToImage_img_" + to_wstring(i) + L".png").c_str());
	}

	delete ppt;
}

Convert PowerPoint to SVG in C++

#include "pch.h"

using namespace std;
using namespace Spire::Presentation;

int main()
{
	std::wstring inputFile = DataPath"ToSVG.pptx";
	std::wstring outputFile = OutputPath"SVG/ToSVG/";

	//Create a PPT document
	Presentation* ppt = new Presentation();
	//Load the file from disk.
	ppt->LoadFromFile(inputFile.c_str());

	//Retain the notes while converting PowerPoint file to svg file.
	ppt->SetIsNoteRetained(true);
	SlideCollection* slides = ppt->GetSlides();
	for (int i = 0; i < slides->GetCount(); i++)
	{
		Stream* svg = slides->GetItem(i)->SaveToSVG();
		svg->Save((outputFile + L"ToSVG-" + to_wstring(i) + L".svg").c_str());
		svg->Dispose();
	}
	delete ppt;

}

Product Page | Forum | Temporary License | Customized Demo

About

Spire.Presentation for C++ is an independent PowerPoint® compatible API that enables developers to create, read, write, modify, and convert PowerPoint documents on any C++ platforms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages