Web SDKv1.0.0

Helpers.createLoadError()

The load-failure card: plain language first ("The PDF appears to be damaged or incomplete."), the SDKError code second and small (the error's own message is its tooltip), then Try another file / Retry.
static methodDocument statessince 1.0.0

Signature

createLoadError(container: HTMLElement, options: LoadErrorOptions): LoadErrorCard

Parameters

ParameterTypeDescription
containerHTMLElementWhere the card is mounted.
optionsLoadErrorOptions{ error, onRetry?, onChooseAnother?, locale?, icons? }. error is what the load rejected with (an SDKError, or anything else); onRetry() and onChooseAnother() back the Retry and Try another file buttons; locale and icons as for createDropZone.

Returns

LoadErrorCard { element, destroy() }.

Example

TypeScript
const card = createLoadError(container, {
  error: err,
  onRetry: () => openPdf(file),
  onChooseAnother: () => zone.open(),
});

More in Helpers