Nutrient MAUI SDK 1.2 migration guide

This article provides a set of guidelines for migrating from version 1.1 to version 1.2 of Nutrient MAUI SDK.

Advanced access to APIs

With the introduction of Nutrient MAUI SDK 1.2, we’ve added the ability to access Nutrient Web SDK APIs directly from the Controller object instead of the Document object. This increases the flexibility of accessing JavaScript APIs in your MAUI application even before a document is loaded:

advanceConfiguration = {
	enableHistory: true,
	disableMultiSelection: true,
	preventTextCopy: true,
};

function setPassword(password) {
	advanceConfiguration.password = password;
}
private void OnPDFViewInitialized(object sender, EventArgs e)
{
    await PDFView.Controller.ExecuteJavaScriptFunctionAsync("setPassword", new object[] { "password-for-this-document" });
    await PDFView.Controller.LoadDocumentFromAssetsAsync("protected.pdf", PDFView.Controller.CreateViewerConfiguration());
}