Learn more about ComPDFKit PDF SDK: https://www.compdf.com/
ComPDFKit Conversion SDK 1.5.0 has been released! With this version, users’ needs for converting PDF to RTF and converting PDF to HTML are satisfied. In this blog post, we will give a detailed introduction to these two formats and show you how to convert PDF to RTF and HTML.
PDF to RTF
Although PDF is a secure format to send and share your files, it is difficult to open PDF files if you share them with someone who doesn’t have a PDF processor. To make sure that anyone can open and read the files, you can choose to convert PDF to RTF.
How to Convert
With ComPDFKit, you can convert PDF to RTF effortlessly. Here we take C# as an example.
string resPath = "***";
string inputFilePath = "***";
string outputFolderPath = "***";
string outputFileName = "***";
CPDFConverter.Init(resPath);
CPDFConverterRTF converter = new CPDFConverterRTF(inputFilePath);
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, pageArray, ref error, getPorgress);
PDF to HTML
Converting PDF to HTML can make people easily find the content of your document in a web search, which ensures your content reaches a wider audience.
What Is HTML
HTML stands for Hypertext markup language. It is a standard markup language designed to display documents online in a browser, and it also helps to create the structure of web pages. HTML consists of many tags including displaying text, tables, ordered lists and unordered lists, etc. If you want to learn more about HTML, please click here.
How to Convert
See how to use ComPDFKit to convert PDF to HTML in C#.
string resPath = "***";
string inputFilePath = "***";
string outputFolderPath = "***";
string outputFileName = "***";
CPDFConvertHTMLOptions htmlOptions = new CPDFConvertHTMLOptions();
htmlOptions.pageAndNavigationPaneOpts = PageAndNavigationPaneOptions.SinglePageNavigationByBookmarks;
CPDFConverter.Init(resPath);
CPDFConverterHTML converter = new CPDFConverterHTML(inputFilePath);
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, htmlOptions, pageArray, ref error, getPorgress);