Skip to content

Highlights

Highlights is a PDF reader for reading and annotating PDF documents. Protocol Launcher allows you to generate Highlights URL scheme links.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

Open File

Open a PDF file using the documented highlights://Users/test.pdf URL shape.

On-Demand
ts
import { openFile } from 'protocol-launcher/highlights'

const url = openFile({
  path: '/Users/test.pdf',
})

Open File At Page

Open the same PDF file and scroll to a documented page fragment.

On-Demand
ts
import { openFileAtPage } from 'protocol-launcher/highlights'

const url = openFileAtPage({
  path: '/Users/test.pdf',
  page: 3,
})

References