Skip to main content

PDF Creation

The Docutain SDK for Android comes with the ability to create searchable and non-searchable PDF documents either from a scanned document with Docutain's Scanner SDK or imported file.

Initialization

Initialize Docutain's Android SDK as described here.

Create a PDF

In order to create a PDF document, first a document needs to be scanned with Docutain's Scanner SDK or imported.

After that you can generate the PDF document.

import de.docutain.sdk.Document

...

//scan or import file

...

val pdfFile = Document.writePDF(File(filesDir, "testPDF"))
if(pdfFile != null){
//do something with the created PDF file
} else{
//error occured
val error = DocutainSDK.getLastError()
}
tip

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

val pdfFile = Document.writePDF(File(filesDir, "testPDF"), true, Document.PDFPageFormat.A4)