Getting Headers or Footers with Golang via C++
Headers and footers are displayed only in Page Layout view, Print Preview, and on printed pages.
You can also use the Page Setup dialog box if you want to view headers or footers for more than one worksheet at a time.
For other sheet types, such as chart sheets or charts, you can insert headers and footers only by using the Page Setup dialog box.
Getting Headers and Footers in MS Excel
- Click the worksheet where you want to view or change headers or footers.
- On the View tab, in the Workbook Views group, click Page Layout. Excel displays the worksheet in Page Layout view.
- To view or edit a header or footer, click the left, center, or right header or footer text box at the top or the bottom of the worksheet page (under Header, or above Footer).
Getting Headers and Footers using Aspose.Cells for Go via C++
With Worksheet.PageSetup.GetHeader and Worksheet.PageSetup.GetFooter methods, Go developers can simply get headers or footers from the file.
- Construct a Workbook to open the file.
- Get the worksheet where you want to get headers or footers.
- Get the header or footer with a specific section ID.
Parse Headers and Footers to Command List
The header or footer text can contain special commands, for example a placeholder for the page number, current date, or text‑formatting attributes.
Special commands are represented by a single letter with a leading ampersand ("&").
The header and footer strings are constructed using ABNF grammar. It’s not easy to understand without a viewer.
Aspose.Cells for Go via C++ provides the Worksheet.PageSetup.GetCommands method to parse headers and footers as a command list.
The following code shows how to parse a header or footer as a command list and process the commands: