Skip to main content

PDF Creation

The Docutain Windows SDK comes with the ability to create searchable and non-searchable PDF documents.

The Docutain SDK needs to be initialized prior to using any functionality of it as described here.

In order to create a PDF document, first a document needs to be imported.

After that you can generate the PDF document.

//import file

...

string filePathGeneratedPDF = Docutain.SDK.Windows.Document.WritePDF(filePathPDF, false, Docutain.SDK.Windows.Document. PDFPageFormat.FitToPages);
if (string.IsNullOrEmpty(filePathGeneratedPDF))
{
string error = DocutainSDK.getLastError()
...
}
tip

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

string filePathPDF = Document.WritePDF(filePathPDF, false, Docutain.SDK.Windows.Document.PDFPageFormat.A4);
tip

You can specify a password that needs to be entered when opening the PDF.

string filePathPDF = Document.WritePDF(filePathPDF, false, Docutain.SDK.Windows.Document.PDFPageFormat.A4, "password");