Skip to main content

sdk.file_2

Home > @matterway/sdk > File_2

File_2 namespace

Classes

ClassDescription
SdkFileRepresents a file that has been loaded into memory from a base64-encoded data string.

Functions

FunctionDescription
convertBase64ToBuffer(data)Converts a base64-encoded string to a Buffer of binary data.
convertBase64ToFile(data, name, type)Creates a File object from base64-encoded data.
downloadFile(ctx, file)Downloads a file by creating a temporary link element with the given file data and metadata and then simulating a click event to trigger a download.
extractPdf(base64, obj)function used to read data in pdf
extractPdfFormFields(base64)function used to read data in pdf
fileFromDrive(path, type)Reads a file from the file system and returns an SdkFile object that contains the file data and metadata.
fileFromUrl(ctx, url)Reads a file from a URL and returns an SdkFile object that contains the file data and metadata.
fileToDrive(file, path)Writes a file to the local drive.
fileToInput(ctx, file, selector)Attaches a file to an input element on a web page, using the Matterway SDK context to execute the attachment process within the page.
fillPdf(base64, obj)function used to prefill data in pdf
PdfViewer({ src })
sanitizeFilePath(path)
showDownloadFile(ctx, options)Shows a message to the user with a download button for the specified file.
showUploadFile(ctx, options)Displays a file upload dialog and returns an array of SdkFile objects containing the selected files' data and metadata.

Interfaces

InterfaceDescription
PdfExtractSelector
PdfExtractSelectorResult
PdfFillSelector
ShowDownloadFileOptions
ShowUploadFileOptionsThe options to configure the file upload dialog.

Variables

VariableDescription
PdfFieldTypes