Import Data into PDF Forms Using Instant JSON

In Standalone mode it’s possible to set form field values in a document by importing them as InstantJSON:

PSPDFKit.load({
	instantJSON: {
		format: "https://pspdfkit.com/instant-json/v1",
		formFieldValues: [
			{
				name: "Form Field 1",
				value: "Text for form field 1",
				type: "pspdfkit/form-field-value", 
				v: 1
			}
		]
	}
});

The snippet above will prefill the form field named “Form Field 1” with the text “Text for form field 1”.

You can also import form field values as InstantJSON using document operations, available with the Document Editor license component:

instance.applyOperations([
	{
		type: "applyInstantJson",
		instantJson: {
			format: "https://pspdfkit.com/instant-json/v1",
			formFieldValues: [
				{
					name: "Form Field 1",
					value: "Text for form field 1",
					type: "pspdfkit/form-field-value", 
					v: 1
				}
			]
		}
	}
])