Edit PDF Outlines Using JavaScript

Information

Creating, editing, or removing document outlines is available when using the PSPDFKit for Web Standalone operational mode.

With PSPDFKit, you can list existing PDF outlines with instance.getDocumentOutline and update them with instance.setDocumentOutline:

async function outlineToUppercase() {
  const outline = await instance.getDocumentOutline();
  const uppercasedOutline = outline.map((outlineElement) =>
    outlineElement.set("title", outlineElement.title.toUpperCase())
  );

  await instance.setDocumentOutline(uppercasedOutline);
}

await outlineToUppercase();