Edit PDF Outlines Using JavaScript

Information

Creating, editing, or removing document outlines is available when using the Web SDK in 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();