Skip to main content

PDF Creation

The Docutain SDK for Flutter comes with the ability to create searchable and non-searchable PDF documents from a scanned document.

Initialization

Initialize the Docutain SDK for Flutter as described here.

Create a PDF

bool rcScan = await DocutainSdkUi.scanDocument(scanConfig);
if(rcScan){
File? pdfFile = await DocutainSdkDocument.writePDF(path, "testPDF");
if (pdfFile != null) {
//do something with the generated PDF
} else{
//pdf creation failed, get the last error
String error = await DocutainSdk.getLastError();
}
}
tip

You can specify the PDF page format by providing the appropriate value

File? pdfFile = await DocutainSdkDocument.writePDF(path, "testPDF", pdfPageFormat: PDFPageFormat.a4);