Information needed to authenticate processing request with Nutrient backend.
Build API instructions that describe the processing operation.
Optionalinputs: BuildInput[]An array of all inputs required for the processing operation.
Promise that resolves to an ArrayBuffer with the processing result.
In case of an error, rejects with a NutrientViewer.Error with detailed error message.
NutrientViewer.build(
// Authorize request.
{ jwt: authPayload.jwt },
// Instructions for the processing request.
{
parts: [
// Use first input as the first part of the final document.
{ file: "document" },
// Use a sample DOCX document served from URL as the second part of the final document.
{
file: {
url: "https://www.nutrient.io/api/downloads/samples/docx/document.docx",
},
},
],
},
// Inputs required by the request. These will be uploaded with the request. The remote file served from URL does not need to be uploaded.
[{ name: "document", content: document }]
);
Performs processing via Nutrient Backend API.
In you are running in standalone mode, the resulting
ArrayBuffercan be converted to PDF with () (if it's not already PDF) and then loaded with ().