PUB · PUBLISHER

Legacy Publisher
API guide

`inspectLegacyPublisher` validates known Publisher Contents signatures and the additional stream set required for Publisher 2002. This is format identification and container inspection, not publication-page support.

IMPLEMENTATION NOTES

What works

The inspector recognizes validated Publisher 97/2000 and 2002 container signatures and returns stream names plus the streams used to validate the result.

IMPLEMENTATION NOTES

Known limits

The package does not decode publication pages, text frames, images, or layout and does not provide a Publisher document writer.

QUICK EXAMPLE

Use the supported API

Import the package root unless a subpath is shown in the sample.

Legacy Publisher · TypeScript
TypeScript
import { inspectLegacyPublisher, writeLegacyOfficeMetadata } from '@christophervr/ole2';

const inspection = inspectLegacyPublisher(pubBytes);
if (inspection) {
  console.log(inspection.version, inspection.validatedStreams);
  const updated = writeLegacyOfficeMetadata(pubBytes, 'title', 'New title');
  if (updated === pubBytes) console.log('Metadata was unchanged or unsupported.');
}

This guide documents the current package API. Unsupported or unsafe operations are described explicitly; format detection alone does not imply content support.

Back to format overview