Comprehensive Guide for Developers: UI & SDK Integration, Configuration, and API Reference
OptionalerrorError that occurred during initialization, if any.
OptionalisLoading state indicator.
The initialized PDF SDK instance. Use this for headless PDF operations such as:
result.sdk.openDocument({ file })result.sdk.openBlankDocument()result.sdk.listSystemFonts()result.sdk.registerUserFonts(fonts)The SDK is already initialized when returned from PdfEditor().
UI components for the PDF editor.
Headless API for building a custom document tab bar.
Always available regardless of whether the built-in tab bar is visible.
Set layoutConfig.tabBar.enabled = false to hide the built-in bar and
use this API to drive your own tab UI instead.
The PDF editor wrapper element.
This element contains the document view and UI controls.
When hideToolsPanel: true is set, the toolbar and panels are hidden
but the wrapper element is still used for consistent API.
Service for managing document view instances. Use this service to:
Show one of the viewer's own snackbars, so a host application can report something in the same place and style the viewer already uses for its notices, instead of a dialog of its own.
message is looked up as a translation key first and falls back to being
rendered verbatim, so both a bundled key and a plain sentence work.
result.ui.showSnackbar('error', 'The file is open in another application.');
Pass options for a long-running job: a progress ring and a trailing action
button. The returned handle drives the snackbar while it is up — write
progress or message to update it in place, close() to dismiss it, and
read isClosed to see whether the user got there first.
Every write is ignored once it has closed, so a late tick from a finished job
cannot resurrect it. The ring only moves on a snackbar shown with a progress
value; it is not added retroactively.
Result object returned from PDF editor initialization.
This is the main return type from PdfEditor function. It provides access to:
Example
Remarks
Headless Mode: Users can work with PDFs without the UI by using the
sdkfield:Alternatively, users can use PdfSdk directly from
'@avanquest/pdf-web-viewer/sdk'. In this case, PdfSdk.initialize must be called manually before any operations: