PDF Creation
The Docutain SDK for Cordova comes with the ability to create searchable PDF documents either from a scanned document with Docutain's Scanner SDK or imported file.
Initialization
Initialize the Docutain Cordova SDK as described here.
Create a PDF
- Cordova Promisify
- Cordova Callback
//...
//scan or import file
//...
try{
const pdfUri = await DocutainSDKPromisify.writePDF('A4')
}catch (error) {
//error occured
console.error(error);
}
//...
//scan or import file
//...
DocutainSDK.writePDF('A4', "", false, function (pdfUri) {
//do something with the created PDF file
}, error);
tip
You can specify to overwrite an existing file and the filename to store the file.
writePDF(pageFormat: PDFPageFormat, fileUri?: string, overWrite?: boolean): Promise<{ fileUri: string }>;