In this tutorial, we will learn how to read bookmarks in PDF file using C++. You can extract the title and different other properties by iterating through all the bookmarks one after another using simple API calls in C++. The feature does not need installation of Adobe Acrobat or any application on Windows or Linux platforms.
Steps to Read Bookmarks in PDF File using C++
- Install the Aspose.Pdf for C++ library from NuGet package manager
- Add the reference to Aspose::Pdf namespace
- Initialize an object of PdfBookmarkEditor class to get bookmarks
- Load the input PDF document for extracting bookmarks
- Retrieve the Bookmarks from the PDF file
- Iterate through all the Bookmarks and read properties
You can read bookmarks in pdf file using C++ with few simple lines of code. It can retrieve bookmarks in pdf file using C++ along with the different properties of each bookmark.
Code to Read Bookmarks in PDF File using C++
In the previous topic, we learned How to Read PDF File in C++. This topic covers how to extract bookmarks in pdf file using C++.