This class offers the necessary API to create a PDF document from a Word document: docx, docm, dotx, dotm, doc,
dot, rtf, txt, WordML, html and markdown, read from a file, a stream or an array of bytes.
Inheritance HierarchySystemObject
ExpertPdf.Anywhere.WordToPdfPdfConverter
Namespace: ExpertPdf.Anywhere.WordToPdfAssembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntaxpublic class PdfConverter
Public Class PdfConverter
The PdfConverter type exposes the following members.
Constructors
Properties| | Name | Description |
|---|
 | AccessibilityStandard |
Gets or sets the accessibility standard the generated document declares. The default value is
None.
|
 | AutoDetectComplexScript |
Gets or sets whether right-to-left and complex scripts are detected in text that does not say so. The default
value is false.
|
 | Bookmarks |
Gets or sets what the PDF outline is built from. The default is Headings.
|
 | EmbedCompleteFonts |
Gets or sets whether whole fonts are embedded rather than the characters used. The default value is false.
|
 | Language |
Gets or sets the natural language of the document content (for example "en-US"). Required for accessible
(PDF/UA) output.
|
 | LicenseKey |
Gets or sets the license key
|
 | OptimizeIdenticalImages |
Gets or sets whether identical pictures are stored once. The default value is true.
|
 | PageRanges |
Gets or sets the pages of the converted document to keep, for example "1,3-5" or "2-" (1-based). The default
is every page.
|
 | PageSetup |
Gets or sets the page size and margins the document is laid out on. The default is
Document: the Word document's own.
|
 | Password |
Gets or sets the password that opens an encrypted Word document.
|
 | PdfDocumentInfo |
Gets a reference to an object to set the document information of the generated PDF document: title, author,
subject, keywords and creation date.
|
 | PdfDocumentOptions |
Gets a reference to an object to control the generated PDF document options. The page size, orientation and
margins are used when PageSetup is Options; the margins also make
room for the header and footer.
|
 | PdfFooterOptions |
Gets a reference to an object to control the generated PDF document footer options
|
 | PdfHeaderOptions |
Gets a reference to an object to control the generated PDF document header options
|
 | PdfSecurityOptions |
Gets a reference to an object to set the security of the generated PDF document: a password to open it, an
owner password, the permissions and the encryption. The document is encrypted only when one of these options
is changed from its default.
|
 | PdfStandardSubset |
Gets or sets the PDF standard of the generated document. The default is
Full.
|
 | PreserveFormFields |
Gets or sets whether the document's form fields become PDF form fields. The default value is false: they are
drawn as they look.
|
 | UpdateFields |
Gets or sets whether the document's fields (dates, page numbers, tables of contents) are updated before it is
converted. The default value is true.
|
Top
Methods| | Name | Description |
|---|
 | GetPdfBytesFromWordBytes(Byte) |
Gets the PDF document converted from a Word document given as an array of bytes, its format detected from the
content (docx, doc, rtf or text).
|
 | GetPdfBytesFromWordBytes(Byte, WordFormat) |
Gets the PDF document converted from a Word document of the given format given as an array of bytes.
|
 | GetPdfBytesFromWordFile(String) |
Gets the PDF document converted from a Word file, its format taken from the file extension.
|
 | GetPdfBytesFromWordFile(String, WordFormat) |
Gets the PDF document converted from a Word file of the given format.
|
 | GetPdfBytesFromWordStream(Stream) |
Gets the PDF document converted from a Word document in a stream, its format detected from the content (docx,
doc, rtf or text).
|
 | GetPdfBytesFromWordStream(Stream, WordFormat) |
Gets the PDF document converted from a Word document of the given format in a stream.
|
 | SavePdfFromWordFileToFile |
Saves the PDF document converted from a Word file to a file.
|
 | SavePdfFromWordFileToStream(String, Stream) |
Saves the PDF document converted from a Word file to a stream.
|
 | SavePdfFromWordFileToStream(String, WordFormat, Stream) |
Saves the PDF document converted from a Word file of the given format to a stream.
|
 | SavePdfFromWordStreamToFile |
Saves the PDF document converted from a Word document in a stream to a file.
|
 | SavePdfFromWordStreamToStream(Stream, Stream) |
Saves the PDF document converted from a Word document in a stream to another stream.
|
 | SavePdfFromWordStreamToStream(Stream, WordFormat, Stream) |
Saves the PDF document converted from a Word document of the given format in a stream to another stream.
|
Top
RemarksThe document is laid out by the Word engine. By default (PageSetup =
Document) the PDF pages take the page sizes and margins of the Word document; with
Options it is reflowed onto the page size, orientation and margins of
PdfDocumentOptions. The header and footer of the converter are drawn above and below the document's
content, on the margins of the page; the document's own headers and footers are part of its content.
Headings become the PDF outline (Bookmarks), links stay live, and the PDF/A, PDF/X and PDF/UA
levels, the security options and the document information apply as they do for the other converters. A
document that needs a font the host does not have is drawn with a metric-compatible substitute.
ExamplePdfConverter pdfConverter = new PdfConverter();
pdfConverter.PdfDocumentOptions.ShowFooter = true;
pdfConverter.PdfFooterOptions.ShowPageNumber = true;
pdfConverter.SavePdfFromWordFileToFile("report.docx", "report.pdf");Dim pdfConverter As New PdfConverter()
pdfConverter.PdfDocumentOptions.ShowFooter = True
pdfConverter.PdfFooterOptions.ShowPageNumber = True
pdfConverter.SavePdfFromWordFileToFile("report.docx", "report.pdf")
See Also