Skip to main content

PDF Creation

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


Initialize the Docutain Capacitor SDK as described here.

Create a PDF

import { DocutainSDK, PDFPageFormat } from '@docutain/capacitor-plugin-docutain-sdk'

//scan or import file

var destinationUri = (await Filesystem.getUri({ path: "sample.pdf", directory:Directory.Data })).uri;
const pdfUri = (await DocutainSDK.writePDF({
fileUri: destinationUri,
overWrite: true,
pageFormat: PDFPageFormat.A4
} catch (error) {

You can specify to overwrite an existing file and the PDF page format by providing the appropriate value.