Speaker notes are hidden notes that can be added to slides to help recall some important or key information. Speaker notes are only visible to the presenter, so adding speaker notes in PowerPoint will not affect the overall visual effectiveness of the document. In this article, you will learn how to programmatically add, read or delete speaker notes in a PowerPoint presentation using Spire.Presentation for C++.

Install Spire.Presentation for C++

There are two ways to integrate Spire.Presentation for C++ into your application. One way is to install it through NuGet, and the other way is to download the package from our website and copy the libraries into your program. Installation via NuGet is simpler and more recommended. You can find more details by visiting the following link.

Integrate Spire.Presentation for C++ in a C++ Application

Add Speaker Notes in PowerPoint in C++

There are a number of benefits to using speaker notes in a PowerPoint presentation, such as it can help you stay on point and also appear more confident during a presentation. The following are the steps to add speaker notes to a specified slide.

  • Create a Presentation instance and load a PowerPoint document using Presentation->LoadFromFile() method.
  • Get a specified slide using Presentation->GetSlides()->GetItem(slideIndex) method.
  • Add a notes slide to the slide using ISlide->AddNotesSlide() method.
  • Create a TextParagraph instance.
  • Set text for the paragraph using TextParagraph->SetText() method, and then append the paragraph to the notes slide using NotesSlide->GetNotesTextFrame()->GetParagraphs()->Append() method.
  • Save the result document using Presentation->SaveToFile() method.
  • C++
#include "Spire.Presentation.o.h";

using namespace Spire::Presentation;
using namespace std;

int main()
{
	//Specify the input and output file paths
	std::wstring inputFile = L"Data\\Template.pptx";
	std::wstring outputFile = L"SpeakerNotes.pptx";

	//Create a Presentation instance
	intrusive_ptr<Presentation> ppt = new Presentation();

	//Load a sample PowerPoint document from disk
	ppt->LoadFromFile(inputFile.c_str());

	//Get the second slide
	intrusive_ptr<ISlide> slide = ppt->GetSlides()->GetItem(1);

	//Add a notes slide
	intrusive_ptr<NotesSlide> notesSlide = slide->AddNotesSlide();

	//Add paragraphs to the notes slide and set the content of the speaker notes
	intrusive_ptr⁢TextParagraph> paragraph = new TextParagraph();
	paragraph->SetText(L"Tips for making effective presentations:");
	notesSlide->GetNotesTextFrame()->GetParagraphs()->Append(paragraph);

	paragraph = new TextParagraph();
	paragraph->SetText(L"Use the slide master feature to create a consistent and simple design template.");
	notesSlide->GetNotesTextFrame()->GetParagraphs()->Append(paragraph);

	paragraph = new TextParagraph();
	paragraph->SetText(L"Simplify and limit the number of words on each screen.");
	notesSlide->GetNotesTextFrame()->GetParagraphs()->Append(paragraph);

	paragraph = new TextParagraph();
	paragraph->SetText(L"Use contrasting colors for text and background.");
	notesSlide->GetNotesTextFrame()->GetParagraphs()->Append(paragraph);

	//Set the bullet type and bullet style for specific paragraphs on the notes slide
	for (int i = 1; i < notesSlide->GetNotesTextFrame()->GetParagraphs()->GetCount(); i++)
	{
		notesSlide->GetNotesTextFrame()->GetParagraphs()->GetItem(i)->SetBulletType(TextBulletType::Numbered);
		notesSlide->GetNotesTextFrame()->GetParagraphs()->GetItem(i)->SetBulletStyle(NumberedBulletStyle::BulletArabicPeriod);
	}

	//Save the result file
	ppt->SaveToFile(outputFile.c_str(), FileFormat::Pptx2013);
	ppt->Dispose();
}

C++: Add, Read or Delete Speaker Notes in PowerPoint

Read Speaker Notes in PowerPoint in C++

To get speaker notes from a notes slide, Spire.Presentation for C++ offers the NotesSlide->GetNotesTextFrame()->GetText() method. The following are the detailed steps.

  • Create a Presentation instance and load a PowerPoint document using Presentation->LoadFromFile() method.
  • Get a specified slide using Presentation->GetSlides()->GetItem(slideIndex) method.
  • Get the notes slide from the slide using ISlide->GetNotesSlide() method.
  • Get the speaker notes from the notes slide using NotesSlide->GetNotesTextFrame()->GetText() method, and then save them to a .txt file.
  • C++
#include "Spire.Presentation.o.h";

using namespace Spire::Presentation;
using namespace std;

int main()
{
	//Specify the input and output file paths
	std::wstring inputFile = L"SpeakerNotes.pptx";
	std::wstring outputFile = L"GetSpeakerNotes.txt";

	//Create a Presentation instance
	intrusive_ptr⁢Presentation> presentation = new Presentation();

	//Load a sample PowerPoint document
	presentation->LoadFromFile(inputFile.c_str());

	//Get the second slide
	intrusive_ptr<ISlide> slide = presentation->GetSlides()->GetItem(1);

	//Get the notes slide from the second slide
	intrusive_ptr<NotesSlide> notesSlide = slide->GetNotesSlide();

	//Get the speaker notes and save to txt file
	wofstream desFile(outputFile, ios::out);
	desFile << notesSlide->GetNotesTextFrame()->GetText() << endl;
	desFile.close();
	presentation->Dispose();
}

C++: Add, Read or Delete Speaker Notes in PowerPoint

Delete Speaker Notes in PowerPoint in C++

With Spire.Presentation for C++, you are also allowed to remove all speaker notes at once or just remove a specified speaker note from the notes slide. The following are the detailed steps.

  • Create a Presentation instance and load a PowerPoint document using Presentation->LoadFromFile() method.
  • Get a specified slide using Presentation->GetSlides()->GetItem(slideIndex) method.
  • Get the notes slide from the slide using ISlide->GetNotesSlide() method.
  • Remove all speaker notes from the notes slide using NotesSlide->GetNotesTextFrame()->GetParagraphs()->Clear() method or remove a specific speaker note from the notes slide using NotesSlide->GetNotesTextFrame()->GetParagraphs()->RemoveAt(paragraphIndex) method.
  • Save the result document using Presentation->SaveToFile() method.
  • C++
#include "Spire.Presentation.o.h";

using namespace Spire::Presentation;
using namespace std;

int main()
{
	//Specify the input and output file paths
	std::wstring inputFile = L"SpeakerNotes.pptx";
	std::wstring outputFile = L"RemoveSpeakerNotes.pptx";

	//Create a Presentation instance
	intrusive_ptr<Presentation> presentation = new Presentation();


	//Load a sample PowerPoint document
	presentation->LoadFromFile(inputFile.c_str());

	//Get the second slide
	intrusive_ptr<ISlide> slide = presentation->GetSlides()->GetItem(1);

	//Get the notes slide from the second slide
	intrusive_ptr<NotesSlide> notesSlide = slide->GetNotesSlide();

	//Remove all the speaker notes from notes slide
	notesSlide->GetNotesTextFrame()->GetParagraphs()->Clear();

	//Remove a specific speak note from notes slide
	//notesSlide->GetNotesTextFrame()->GetParagraphs()->RemoveAt(1);

	//Save the result file
	presentation->SaveToFile(outputFile.c_str(), FileFormat::Pptx2013);
	presentation->Dispose();
}

C++: Add, Read or Delete Speaker Notes in PowerPoint

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

C++: Convert PDF to PDF/A or PDF/X

2023-04-19 00:45:05 Written by Koohji

PDF/A and PDF/X are two subsets of PDF file formats that were created to standardize the use of PDF in different areas. The former, PDF/A format, is primarily used for the long-term preservation or archiving of electronic documents, while the latter, PDF/X format, is specifically designed for the reliable and accurate pre-print exchange of graphic data. This article will demonstrate how to programmatically convert PDF to PDF/A or PDF/X format using Spire.PDF for C++.

Install Spire.PDF for C++

There are two ways to integrate Spire.PDF for C++ into your application. One way is to install it through NuGet, and the other way is to download the package from our website and copy the libraries into your program. Installation via NuGet is simpler and more recommended. You can find more details by visiting the following link.

Integrate Spire.PDF for C++ in a C++ Application

Convert PDF to PDF/A-1A, 2A, 3A, 1B, 2B and 3B in C++

With the passage of time, PDF/A has been continuously enhanced and further standards such as PDF/A-1, PDF/A-2 and PDF/A-3 have been developed. In addition, each standard defines several different levels of conformance. The following are the steps to convert PDF to PDF/A-1A, 2A, 3A, 1B, 2B and 3B compliant files.

  • Create a PdfStandardsConverter instance, and pass in a sample PDF file as a parameter.
  • Convert the sample file to PdfA1A conformance level using PdfStandardsConverter->ToPdfA1A() method.
  • Convert the sample file to PdfA1B conformance level using PdfStandardsConverter->ToPdfA1B() method.
  • Convert the sample file to PdfA2A conformance level using PdfStandardsConverter->ToPdfA2A() method.
  • Convert the sample file to PdfA2B conformance level using PdfStandardsConverter->ToPdfA2B() method.
  • Convert the sample file to PdfA3A conformance level using PdfStandardsConverter->ToPdfA3A() method.
  • Convert the sample file to PdfA3B conformance level using PdfStandardsConverter->ToPdfA3B() method.
  • C++
#include "Spire.Pdf.o.h";

using namespace Spire::Pdf;
using namespace std;
int main() {

	//Specify the input file
	wstring inputFile = L"Data\\Test.pdf";

	//Create a PdfStandardsConverter instance
	PdfStandardsConverter* converter = new PdfStandardsConverter(inputFile.c_str());

	//Convert to PdfA1A
	converter->ToPdfA1A(L"Output/ToPdfA1A.pdf");

	//Convert to PdfA1B
	converter->ToPdfA1B(L"Output/ToPdfA1B.pdf");

	//Convert to PdfA2A
	converter->ToPdfA2A(L"Output/ToPdfA2A.pdf");

	//Convert to PdfA2B
	converter->ToPdfA2B(L"Output/ToPdfA2B.pdf");

	//Convert to PdfA3A
	converter->ToPdfA3A(L"Output/ToPdfA3A.pdf");

	//Convert to PdfA3B
	converter->ToPdfA3B(L"Output/ToPdfA3B.pdf");

	delete converter;
}

C++: Convert PDF to PDF/A or PDF/X

Convert PDF to PDF/X-1a:2001 Standard in C++

PDF/X-1a:2001 is a standard published in 2001 and has been widely adopted by the printing and publishing industries. It restricts certain features of the PDF format to ensure that the file is suitable for high quality printing. The following are the steps to convert PDF to a PDF/X-1a:2001 standard-compliant file.

  • Create a PdfStandardsConverter instance, and pass in a sample PDF file as a parameter.
  • Convert the sample file to PDF/X-1a:2001 standards compliant file using PdfStandardsConverter->ToPdfX1A2001() method.
  • C++
#include "Spire.Pdf.o.h";

using namespace Spire::Pdf;
using namespace std;
int main() {

	//Specify the input file
	wstring inputFile = L"Data\\Test.pdf";

	//Create a PdfStandardsConverter instance
	PdfStandardsConverter* converter = new PdfStandardsConverter(inputFile.c_str());

	//Convert to PDF/X-1a:2001
	converter->ToPdfX1A2001(L"Output/ToPdfX1A2001.pdf");
	converter->Dispose();
	delete converter;
}

C++: Convert PDF to PDF/A or PDF/X

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

Sometimes, certain rows and columns of an Excel file may contain sensitive or confidential information. Before presenting the file to others, it is critical to hide these specific rows and columns to prevent unauthorized people from viewing this information. After the representation, you can show the hidden rows and columns to redisplay the information as needed. In this article, we will demonstrate how to hide or show rows and columns in Excel in C++ using Spire.XLS for C++.

Install Spire.XLS for C++

There are two ways to integrate Spire.XLS for C++ into your application. One way is to install it through NuGet, and the other way is to download the package from our website and copy the libraries into your program. Installation via NuGet is simpler and more recommended. You can find more details by visiting the following link.

Integrate Spire.XLS for C++ in a C++ Application

Hide Specific Rows and Columns in Excel in C++

You can hide specific rows and columns in an Excel worksheet by using the XlsWorksheet->HideRow(int rowIndex) and XlsWorksheet->HideColumn(int columnIndex) methods. The detailed steps are as follows:

  • Initialize an instance of the Workbook class.
  • Load an Excel file using Workbook->LoadFromFile() method.
  • Get a specific worksheet using Workbook->GetWorksheets()->Get(int index) method.
  • Hide specific rows in the worksheet using XlsWorksheet->HideRow(int rowIndex) method.
  • Hide Specific columns in the worksheet using XlsWorksheet->HideColumn(int columnIndex) method.
  • Save the result file using Workbook->SaveToFile() method.
  • C++
#include "Spire.Xls.o.h";

using namespace Spire::Xls;

int main()
{
	//Initialize an instance of the workbook class
	intrusive_ptr<Workbook> workbook = new Workbook();
	//Load an Excel file
	workbook->LoadFromFile(L"Input.xlsx");

	//Get the first worksheet
	intrusive_ptr<Worksheet> sheet = dynamic_pointer_cast<Worksheet>(workbook->GetWorksheets()->Get(0));

	//Hide the 3rd and the 7th rows
	sheet->HideRow(3);
	sheet->HideRow(7);

	//Hide the 3rd and the 6th columns
	sheet->HideColumn(3);
	sheet->HideColumn(6);

	//Save the result file
	workbook->SaveToFile(L"HideRowsAndColumns.xlsx", ExcelVersion::Version2013);
	workbook->Dispose();
}

C++: Hide or Show Rows and Columns in Excel

Show Specific Hidden Rows and Columns in Excel in C++

To show specific hidden rows and columns in an Excel worksheet, you can use the XlsWorksheet->ShowRow(int rowIndex) and XlsWorksheet->ShowColumn(int columnIndex) methods. The detailed steps are as follows:

  • Initialize an instance of the Workbook class.
  • Load an Excel file using Workbook->LoadFromFile() method.
  • Get a specific worksheet using Workbook->GetWorksheets()->Get(int index) method.
  • Show specific hidden rows in the worksheet using XlsWorksheet->ShowRow(int rowIndex) method.
  • Show specific hidden columns in the worksheet using XlsWorksheet->ShowColumn(int columnIndex) method.
  • Save the result file using Workbook->SaveToFile() method.
  • C++
#include "Spire.Xls.o.h";

using namespace Spire::Xls;

int main()
{
	//Initialize an instance of the workbook class
	intrusive_ptr<Workbook> workbook = new Workbook();
	//Load an Excel file
	workbook->LoadFromFile(L"HideRowsAndColumns.xlsx");

	//Get the first worksheet
	intrusive_ptr<Worksheet> sheet = dynamic_pointer_cast<Worksheet>(workbook->GetWorksheets()->Get(0));

	//Show the 3rd and the 7th rows
	sheet->ShowRow(3);
	sheet->ShowRow(7);

	//Show the 3rd and the 6th columns
	sheet->ShowColumn(3);
	sheet->ShowColumn(6);

	//Save the result file
	workbook->SaveToFile(L"ShowRowsAndColumns.xlsx", ExcelVersion::Version2013);
	workbook->Dispose();
}

C++: Hide or Show Rows and Columns in Excel

Hide Multiple Rows and Columns at Once in Excel in C++

You can hide multiple adjacent rows and columns at once by using the XlsWorksheet->HideRows(int rowIndex, int rowCount) and XlsWorksheet->HideColumns(int columnIndex, int columnCount) methods. The detailed steps are as follows:

  • Initialize an instance of the Workbook class.
  • Load an Excel file using Workbook->LoadFromFile() method.
  • Get a specific worksheet using Workbook->GetWorksheets()->Get(int index) method.
  • Hide multiple adjacent rows in the worksheet at once using XlsWorksheet->HideRows(int rowIndex, int rowCount) method.
  • Hide multiple adjacent columns in the worksheet at once using XlsWorksheet->HideColumns(int columnIndex, int columnCount) method.
  • Save the result file using Workbook->SaveToFile() method.
  • C++
#include "Spire.Xls.o.h";

using namespace Spire::Xls;

int main()
{
	//Initialize an instance of the workbook class
	intrusive_ptr<Workbook> workbook = new Workbook();
	//Load an Excel file
	workbook->LoadFromFile(L"Input.xlsx");

	//Get the first worksheet
	intrusive_ptr<Worksheet> sheet = dynamic_pointer_cast<Worksheet>(workbook->GetWorksheets()->Get(0));

	//Hide the 3rd, 4th and 5th rows
	sheet->HideRows(3, 3);

	//Hide the 5th, 6th and 7th columns
	sheet->HideColumns(5, 3);

	//Save the result file
	workbook->SaveToFile(L"HideMultipleRowsAndColumns.xlsx", ExcelVersion::Version2013);
	workbook->Dispose();
}

C++: Hide or Show Rows and Columns in Excel

Show All Hidden Rows and Columns in Excel in C++

To show all the hidden rows and columns in an Excel worksheet, you need to iterate through all the rows and columns in the worksheet, then find the hidden rows and columns and call the XlsWorksheet->ShowRow(int rowIndex) and XlsWorksheet->ShowColumn(int columnIndex) methods to redisplay them. The detailed steps are as follows:

  • Initialize an instance of the Workbook class.
  • Load an Excel file using Workbook->LoadFromFile() method.
  • Get a specific worksheet using Workbook->GetWorksheets()->Get(int index) method.
  • Iterate through all the rows in the worksheet, then find the hidden rows using XlsWorksheet->GetRowIsHide(int rowIndex) method.
  • Show the hidden rows using XlsWorksheet->ShowRow(int rowIndex) method.
  • Iterate through all the columns in the worksheet, then find the hidden columns using XlsWorksheet->GetColumnIsHide(int columnIndex) method.
  • Show the hidden columns using XlsWorksheet->ShowColumn(int columnIndex) method.
  • Save the result file using Workbook->SaveToFile() method.
  • C++
#include "Spire.Xls.o.h";

using namespace Spire::Xls;

int main() 
{
	//Initialize an instance of the workbook class
	intrusive_ptr<Workbook> workbook = new Workbook();
	//Load an Excel file
	workbook->LoadFromFile(L"HideMultipleRowsAndColumns.xlsx");

	//Get the first worksheet
	intrusive_ptr<Worksheet> sheet = dynamic_pointer_cast<Worksheet>(workbook->GetWorksheets()->Get(0));

	//Iterate through all the rows in the worksheet
	for (int i = 1; i <= sheet->GetLastRow(); i++)
	{
		//Check if the current row is hidden
		if (sheet->GetRowIsHide(i))
		{
			sheet->ShowRow(i);
		}
	}

	//Iterate through all the columns in the worksheet
	for (int j = 1; j <= sheet->GetLastColumn(); j++)
	{
		//Check if the current column is hidden
		if (sheet->GetColumnIsHide(j))
		{
			//Show the hidden column
			sheet->ShowColumn(j);
		}
	}

	//Save the result file
	workbook->SaveToFile(L"ShowAllHiddenRowsAndColumns.xlsx", ExcelVersion::Version2013);
	workbook->Dispose();
}

C++: Hide or Show Rows and Columns in Excel

Apply for a Temporary License

If you'd like to remove the evaluation message from the generated documents, or to get rid of the function limitations, please request a 30-day trial license for yourself.

page 89