Skip to content

modern-pdf-lib


modern-pdf-lib / buildViewerPreferencesDict

Function: buildViewerPreferencesDict()

buildViewerPreferencesDict(prefs): PdfDict

Defined in: src/metadata/viewerPreferences.ts:88

Build a /ViewerPreferences dictionary from preferences.

Only includes entries for properties that are explicitly set (non-undefined). Boolean values of false are included to explicitly override viewer defaults.

Parameters

prefs

ViewerPreferences

Viewer preferences to serialize.

Returns

PdfDict

A PdfDict representing the /ViewerPreferences entry.

Released under the MIT License.