Skip to content

Convert PDF to Word in C Sharp with ComPDFKit

Youna edited this page Mar 7, 2023 · 1 revision

string resPath = "***";
string inputFilePath = "***";
string outputFolderPath = "***";
string outputFileName = "***";
OnProgress getPageIndex = null;

CPDFConverter.Init(resPath);
CPDFConverterWord converter = new CPDFConverterWord(inputFilePath);

int pageCount = converter.GetPagesCount();
int[] pageArray = new int[pageCount];
for (int i = 0; i < pageArray.Length; i++)
{
pageArray[i] = i + 1;
}

getPageIndex += GetPageIndex;
CPDFConvertWordOptions options = new CPDFConvertWordOptions();
converter.Convert(outputFolderPath, outputFileName, options, pageArray, getPageIndex);