Click or drag to resize
Pdf Library for .NET

PdfToWord Class

Pdf to Word Converter. This class offers the API needed to convert a pdf document to an editable Word document (docx), or to rtf, OpenDocument text, html or markdown (Format).
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfToWord

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.6
Syntax
public class PdfToWord

The PdfToWord type exposes the following members.

Constructors
 NameDescription
Public methodPdfToWordCreates a pdf to Word converter with the default options.
Top
Properties
 NameDescription
Public propertyConversionResult Gets what the last conversion reported: the fonts of the document and what became of each. Null before the first conversion.
Public propertyOptionsGets the conversion options.
Top
Methods
 NameDescription
Public methodConvertBytesConverts a pdf held in memory.
Public methodConvertFileConverts a pdf file.
Public methodConvertStreamConverts a pdf read from a stream.
Top
Remarks

Every page is read as text, images and graphics; its text is grouped into paragraphs with their role (title, headings, list items, captions, footnotes, headers and footers) and read across its columns in reading order, and the document is written with Word's heading and list styles, tables, pictures, hyperlinks, bookmarks, page setup and the document's fonts. Flowing (the default) gives a document to edit; Exact one that looks like the pdf page for page.

The conversion runs in-process. A scanned page without a text layer comes out as its picture. ConversionResult says what became of each of the document's fonts.

Example
PdfToWord converter = new PdfToWord();
converter.Options.Layout = PdfToWordLayout.Flowing;
byte[] docx = converter.ConvertFile("report.pdf");
File.WriteAllBytes("report.docx", docx);
See Also