On this page
Guides
Convert PDF to RTF
Overview
RTF is a popular text format that can retain the format and style data of the text, and it is convenient for most text readers to read and write. Integrate ComPDFKit Conversion SDK to conevert PDF to RTF files now.
Sample
This sample demonstrates how to convert from a PDF to RTF file.
c#
string inputFilePath = "***";
string outputFolderPath = "***";
string outputFileName = "***";
CPDFConverterRTF converter = CPDFConvertFactroy.CreateConverter(CPDFConvertType.CPDFConvertTypeRtf, inputFilePath) as CPDFConverterRTF;
CPDFConvertRTFOptions rtfOptions = new CPDFConvertRTFOptions();
rtfOptions.IsAllowOCR = false;
rtfOptions.IsContainAnnotations = true;
rtfOptions.IsContainImages = true;
int pageCount = converter.GetPagesCount();
int[] pageArray = new int[pageCount];
for (int i = 0; i < pageArray.Length; i++)
{
pageArray[i] = i + 1;
}
ConvertError error = ConvertError.ERR_UNKNOWN;
converter.Convert(outputFolderPath, ref outputFileName,rtfOptions, pageArray, ref error, getPorgress);