Performing Multiple Extraction
SmartExtract also supports extracting multiple data sets from a single pdf/xlsx file. There might be cases when your documents may have say multiple operating statements or operating statements and rent rolls in a single file. In such cases you could choose to launch multiple independent SmartExtract sessions to extract multiple data sets or you could launch a single session to let your users extract multiple datasets from single file in one go.
Using SmartExtract API
With SmartExtract API you could pass the option to start a multi-extraction session while calling the startSession API
smex.startSession(
// the DOM element on which iframe should be mounted
// e.g. document.getElementById('iframeWrapper'),
mountNode,
// The auth token you obtained after hitting the
// authentication API,
sessionAuthToken,
// options, (optional)
{
// optional css classes to be applied to the iframe
iframeClass: '<css classses to be applied to the iframe>',
// start a mult-extraction session
multiple: true,
}
);
Using SmartExtractSimple API
With SmartExtract API you could pass the option to start a multi-extraction session while calling the extractDocumentData API
const data = await smex.extractDocumentData({
session: {
mountNode: $('#smexWrapper')[0],
sessionAuthToken: token,
closeOnComplete: false,
// start a mult-extraction session
multiple: true,
},
file: fileDataUrl,
fileName: file.name,
});
Last updated