PDF form support using JavaScript
Nutrient supports all common PDF form field types defined by the PDF specification. Read, fill, and submit PDF forms — either with the UI tools, or directly by calling the PDF Form API. Get additional resources by visiting our JavaScript PDF forms library.
import PSPDFKit from "@nutrient-sdk/viewer";
export function load(defaultConfiguration) { return PSPDFKit.load(defaultConfiguration).then((instance) => { console.log("Nutrient Web SDK successfully loaded!!", instance);
// You can find an introductions to annotations in our guides: // https://www.nutrient.io/guides/web/forms/introduction-to-forms/ instance.getFormFields().then(function (formFields) { console.log("All form fields", formFields.toJS());
instance.setFormFieldValues({ "Client first and last name": "Nutrient Web SDK", "Description 1": "Loaded Nutrient Web SDK successfully", "Description 2": "Printed out all form fields in the JS Console", "Description 3": "Now filling out the form fields programmatically", }); });
return instance; });}
This code sample is an example that illustrates how to use our SDK. Please adapt it to your specific use case.