For the complete documentation index, see llms.txt. This page is also available as Markdown.

Edit PDF outlines: text, color, action using JavaScript

Requirements

These packages are required to use these features in production. Trial keys have unlimited access to all features

Package: Page ManipulationLive demo

To rename or edit an outline's color in an existing document.

<html>
  <script src="../lib/core/CoreControls.js"></script>
  <script src="../lib/core/pdf/PDFNet.js"></script>
  <script>
    (async function() {
      CoreControls.setWorkerPath('../lib/core');
      const doc = await PDFNet.PDFDoc.createFromURL(filename);
      const root = await doc.getFirstBookmark();

      // Rename outline
      root.setTitle('new outline');

      // Adding color to Outlines. Color and other formatting can help readers
      // get around more easily in large PDF documents.
      root.setColor(1, 0, 0);
    })()
  </script>
</html>

Read, add, edit PDF outlines Full code sample which illustrates how to read and edit existing outline items and create new outlines using the high-level API

About editing an outline

The Outline API allows you to change any property on an outline item, including title text, action, color, and formatting. Color and other formatting can help readers navigate large PDF documents more easily. The above code renames an outline and also adjusts color and formatting properties on an Outline item.

Last updated

Was this helpful?