Our Salesforce implementation integrates Apryse WebViewer inside a Lightning Web Component (LWC).
The integration allows for bi‑directional communication:
postMessage to the iframe.postMessage back to the parent window.This allows Salesforce data and WebViewer actions to stay in sync (e.g., loading documents, updating fields, tracking annotations).
This article highlights entry point of editing when you want to manipulate the data being sent to WebViewer and the information being sent back. This guide also includes how Salesforce and WebViewer communicate.
<iframe> that loads WebViewer.postMessage to send commands and Salesforce payloads into WebViewer.window.addEventListener('message', ...) to receive messages from LWC.parent.postMessage(...) to send information back to the LWC.LOAD_DOCUMENT.DOCUMENT_LOADED.DOCUMENT_LOADED message.In the LWC, you’ll typically:
postMessage on its contentWindow.apryseWvInstance.js
Typical fields include:
In the WebViewer config file (e.g., config_apex.js), you’ll set up a message listener.
config_apex.js
config_apex.js
You can map any message type to WebViewer APIs. For example:
From within the WebViewer iframe, parent gives you access to the LWC’s window.
You can send information back using parent.postMessage.
apryseWvInstance.js
You might call this from WebViewer event handlers:
config_apex.js
On the Salesforce side, you’ll register a message event listener on window in the LWC.
apryseWvInstance.js
To keep things maintainable:
LOAD_DOCUMENT, SAVE_ANNOTATIONS, SET_READONLY).Did you find this helpful?
Trial setup questions?
Ask experts on DiscordNeed other help?
Contact SupportPricing or product questions?
Contact Sales