PDFPageAnnoLayer: sync() method

Works in all major browsers
Since July 2026

WebPDF works in Chrome and Edge 125, Firefox 153 and Safari 18, on desktop and mobile, and in every later version: the oldest versions its PDF.js build supports, which already have every platform feature WebPDF needs. Since July 2026, that is every major browser.

The sync() method of the PDFPageAnnoLayer interface makes the form fields of a <pdf-page> show the values stored in its file.

Pages keep their fields in sync as you type, across every page of the file. Call sync() after you change formData from script, or after importing values, so that checkboxes, radio buttons, lists and text fields show them.

Syntax

js
sync()

Parameters

None.

Return value

None (undefined).

Exceptions

None.

Examples

Setting a field from script

js
const page = document.querySelector("pdf-page");
const data = page.file.formData;
data["12R"] = { value: "Ada Lovelace" };
page.file.formData = data;
for (const p of page.file.pages) p.anno.sync();

Specifications

Not part of any specification. <pdf-file> and <pdf-page> are autonomous custom elements defined by WebPDF.pro. It implements:

Specification
ISO 32000-2:2020 (PDF 2.0)
# 12.7 Forms

Browser compatibility

desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
sync()
1251251531111812515383182712518

Legend

Full support

See also