Change Acrobat Bookmark Text to Uppercase, Lowercase, or Title Case in C++
Question details
The user wants to change PDF bookmark text to uppercase, lowercase, or title case from an Acrobat plug-in written in C++.

- Product
- Adobe Acrobat SDK
- Device & OS
- Windows
- Scenario
- An Acrobat plug-in developer needs to convert bookmark text capitalization using C++ or Visual C++.
- Observed behavior
- Bookmark titles should be converted to the desired case and assigned back to the PDF bookmarks.
Identify how your plug-in reads and writes bookmark titles using the Acrobat SDK version you have installed. Check the title's encoding before choosing a string conversion method.
Convert the Bookmark Title with C++ String Functions
Use C++ string manipulation to change capitalization, then write the result back through the Acrobat SDK.
Case conversion is a string-manipulation task, not a dedicated Acrobat SDK feature. The example below handles basic single-byte English text; it is not a Unicode-aware solution.
The example's title case capitalizes the first character and each character after whitespace. It does not implement editorial title-case rules or treat punctuation as a word boundary.
In your Acrobat plug-in, retrieve the bookmark title using the bookmark APIs documented for your SDK version and convert it to a C++ string in the encoding your conversion code expects.
In your C++ source file, include <string> and <cctype>. For basic English text, use this function with mode 'u' for uppercase, 'l' for lowercase, or 't' for title case: std::string changeCase(std::string text, char mode) { bool wordStart = true; for (char& ch : text) { unsigned char c = static_cast<unsigned char>(ch); if (mode == 'u') { ch = static_cast<char>(std::toupper(c)); } else if (mode == 'l') { ch = static_cast<char>(std::tolower(c)); } else if (mode == 't') { ch = static_cast<char>(wordStart ? std::toupper(c) : std::tolower(c)); wordStart = std::isspace(c) != 0; } } return text; }
Convert the result to the text representation required by your Acrobat SDK version, call its bookmark-title setter, and save the PDF through your plug-in's document-saving workflow.

Manually Rename PDF Bookmarks in WPS Office
For a manual alternative, open a PDF in WPS Office and edit a bookmark's title to the capitalization you want. This does not replace C++ automation or an Acrobat plug-in.
- 1. Open the PDF: Open WPS Office, select Open, and choose the PDF containing the bookmark.
- 2. Find the bookmark: Open the Bookmarks panel and locate the title you want to change.
- 3. Rename the title: Right-click the bookmark, choose Rename if available, and enter the title in your preferred case.
- 4. Save the PDF: Select Save or Save As to keep the updated bookmark title.

Frequently Asked Questions
Does the Acrobat SDK have a bookmark case-conversion function?
Case conversion is generally handled by your C++ string library or framework. Use the Acrobat SDK to read the bookmark title and assign the converted text back.
Can I use MFC instead of the C++ standard library?
Yes. If your plug-in uses MFC, use the string functions appropriate to your MFC string type, then convert the result to the text representation required by the Acrobat bookmark API.
Will the C++ example work with UTF-8 bookmark titles?
Not reliably. The example applies single-byte character functions to each byte. For multilingual UTF-8 titles, use a Unicode-aware library and preserve the encoding expected by the Acrobat SDK.
Can I change a bookmark's capitalization without writing code?
Yes. In a PDF editor such as WPS Office, open the Bookmarks panel, right-click the bookmark, and choose Rename if that option is available. Enter the desired capitalization and save the PDF.




