Click or drag to resize
Pdf Library for .NET

PdfWordSection Class

Represents a Word document that can be added to the header or footer templates of a pdf document.
Inheritance Hierarchy
SystemObject
  SelectPdf.UniversalPdfSectionElement
    SelectPdf.UniversalPdfWordSection

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public class PdfWordSection : PdfSectionElement

The PdfWordSection type exposes the following members.

Constructors
 NameDescription
Public methodPdfWordSection(Stream) Creates a Word section from a stream that can be added to the header or footer templates of a pdf document.
Public methodPdfWordSection(String) Creates a Word section from a file that can be added to the header or footer templates of a pdf document.
Public methodPdfWordSection(Single, Single, Stream) Creates a Word section from a stream that can be added to the header or footer templates of a pdf document.
Public methodPdfWordSection(Single, Single, String) Creates a Word section from a file that can be added to the header or footer templates of a pdf document.
Public methodPdfWordSection(Single, Single, Single, Stream) Creates a Word section from a stream that can be added to the header or footer templates of a pdf document.
Public methodPdfWordSection(Single, Single, Single, String) Creates a Word section from a file that can be added to the header or footer templates of a pdf document.
Top
Properties
 NameDescription
Public propertyAutoDetectComplexScript Gets or sets whether complex scripts (Arabic, Hebrew, Indic) are detected and shaped even where the document does not mark them. Default: false.
Public propertyEmbedCompleteFonts Gets or sets whether the fonts are embedded complete rather than as subsets. Default: false.
Public propertyExternalLinksEnabledRender the document's web links as clickable links on every page that shows the band. Default: true.
Public propertyFilePath Gets the path of the Word document, or null when the section was created from a stream.
Public propertyFormat Gets or sets the format the document is read as. Default: Automatic, which takes the format from the file extension, or detects it from the content (docx family, doc, rtf, WordML) for a stream. Plain text, html and markdown have no signature and must be named here when given as a stream.
Public propertyHeight Gets or sets the element height, in points, in the destination pdf page.
(Inherited from PdfSectionElement)
Public propertyInternalLinksEnabledRender the document's bookmark links that point inside the shown page as internal pdf links. Default: true.
Public propertyLFN Path of the diagnostic log file written while rendering. When unset, no log is written.
Public propertyOptimizeIdenticalImages Gets or sets whether identical images are stored once. Default: true.
Public propertyPageRanges Selects the page of the rendered document that is shown in the band, e.g. "2". A band shows one page; the first page listed is used. Empty (the default) shows the first page.
Public propertyPassword Gets or sets the password of an encrypted document. Default: null (the document is not encrypted).
Public propertyUpdateFields Gets or sets whether the document's fields (dates, page references, formulas) are updated before rendering. Default: true.
Public propertyWidth Gets or sets the element width, in points, in the destination pdf page.
(Inherited from PdfSectionElement)
Public propertyX Gets or sets the element position on the X axis.
(Inherited from PdfSectionElement)
Public propertyY Gets or sets the element position on the Y axis.
(Inherited from PdfSectionElement)
Top
Remarks

The document can be given as a file path or as a stream, in any of the formats of WordFormat. It is rendered once, in-process, with every page set to the size of the destination rectangle and no margins of its own (the header or footer band is the paper), and the resulting first page is drawn onto the header or footer of every page - scaled to the band's width and cut at its height, never stretched. Hyperlinks in the document stay clickable on every page that shows the band.

A section is independent of the converter it is used with: a PdfWordSection can head the pages of a WordToPdf conversion or of an HtmlToPdf one.

Example
WordToPdf converter = new WordToPdf();
converter.Options.DisplayHeader = true;
converter.Header.Height = 50;
converter.Header.Add(new PdfWordSection("header.docx"));
PdfDocument doc = converter.ConvertFile("report.docx");
doc.Save("out.pdf");
doc.Close();
See Also