Click or drag to resize

WordToPdfElement Class

A Word document drawn into a page region, the Word counterpart of HtmlToPdfElement.
Inheritance Hierarchy
SystemObject
  ExpertPdf.Anywhere.PdfDocumentPageElement
    ExpertPdf.Anywhere.PdfDocumentPageGraphicElement
      ExpertPdf.Anywhere.PdfDocumentWordToPdfElement

Namespace: ExpertPdf.Anywhere.PdfDocument
Assembly: ExpertPdf.Anywhere (in ExpertPdf.Anywhere.dll) Version: 22.0
Syntax
public sealed class WordToPdfElement : PageGraphicElement

The WordToPdfElement type exposes the following members.

Constructors
 NameDescription
Public methodWordToPdfElement(Stream)Creates an element that draws a Word document read from a stream from the top left corner of the page.
Public methodWordToPdfElement(String)Creates an element that draws a Word file from the top left corner of the page.
Public methodWordToPdfElement(Single, Single, Stream)Creates an element that draws a Word document read from a stream at a position on the page.
Public methodWordToPdfElement(Single, Single, String)Creates an element that draws a Word file at a position on the page.
Public methodWordToPdfElement(Single, Single, Single, Stream)Creates an element that draws a Word document read from a stream at a position with a width.
Public methodWordToPdfElement(Single, Single, Single, String)Creates an element that draws a Word file at a position with a width.
Public methodWordToPdfElement(Single, Single, Single, Single, Stream)Creates an element that draws a Word document read from a stream in a rectangle.
Public methodWordToPdfElement(Single, Single, Single, Single, String)Creates an element that draws a Word file in a rectangle.
Top
Properties
 NameDescription
Public propertyActualText Gets or sets the exact text this element stands for in a tagged document, when its content does not spell it (text drawn as an image or with an unusual font, for example). The default value is null.
(Inherited from PageElement)
Public propertyAlternateText Gets or sets the alternate description of this element in a tagged document, read by assistive technology instead of the content - the description of a figure, for example. PDF/UA requires it for figures. The default value is null.
(Inherited from PageElement)
Public propertyArtifact Gets or sets whether this element is decorative in a tagged document: it is marked as an artifact (a background, a rule, a running header) and left out of the logical structure. The default value is false.
(Inherited from PageElement)
Public propertyAutoDetectComplexScriptGets or sets whether right-to-left and complex scripts are detected in text that does not say so. The default value is false.
Public propertyBackColor Gets or sets the element background color.
(Inherited from PageGraphicElement)
Public propertyBlending Gets or sets the blending mode for the transparent rendering of the element.
(Inherited from PageGraphicElement)
Public propertyBookmarksGets or sets what the document's outline entries are built from. The default is Headings.
Public propertyColorSpace Gets or sets the color space the element colors are written in: RGB (the default), CMYK or grayscale.
(Inherited from PageGraphicElement)
Public propertyEmbedCompleteFontsGets or sets whether whole fonts are embedded rather than the characters used. The default value is false.
Public propertyForeColor Gets or sets the element foreground color.
(Inherited from PageGraphicElement)
Public propertyFormat Gets or sets the format of the document. The default, Automatic, takes it from the file extension, or detects it from the content of a stream.
Public propertyGradient Gets or sets the gradient used to fill a shape.
(Inherited from PageGraphicElement)
Public propertyHeightGets or sets the height, in points; -1 to flow onto the pages that follow.
Public propertyInternalLinksEnabledGets or sets whether the document's links to places in itself are live. The default value is true.
Public propertyLineStyle Gets or sets the line style of the elements that render lines.
(Inherited from PageGraphicElement)
Public propertyLiveUrlsEnabledGets or sets whether the document's web links are live. The default value is true.
Public propertyOptimizeIdenticalImagesGets or sets whether identical pictures are stored once. The default value is true.
Public propertyPageRangesGets or sets the pages of the rendered document drawn, for example "1-3". The default is every page.
Public propertyPasswordGets or sets the password that opens an encrypted Word document.
Public propertyPdfPagesRectangles Gets where each slice of the document was drawn, after the element is added to a page: one rectangle per page it covers, in that page's coordinates.
Public propertyRotated Gets whether the element is rotated (Rotate was called with a non-zero angle).
(Inherited from PageGraphicElement)
Public propertyScaled Gets whether the element is scaled (Scale was called with a factor other than 1).
(Inherited from PageGraphicElement)
Public propertySkewed Gets whether the element is skewed (Skew was called with a non-zero angle).
(Inherited from PageGraphicElement)
Public propertyTagged Gets or sets whether the region carries the Word document's structure into a tagged document. The default value is false; in a tagged document the region is tagged even when it is false, unless it is an Artifact.
Public propertyTagType Gets or sets the structure type of this element in a tagged document (a heading, a paragraph, a figure and so on). Every element added to a tagged document must have a tag type or be an Artifact. Ignored in a document that is not tagged. The default value is null.
(Inherited from PageElement)
Public propertyTranslated Gets whether the element is translated (Translate was called with a non-zero offset).
(Inherited from PageGraphicElement)
Public propertyTransparency Gets or sets the element transparency, as a value between 0 and 100: 0 means completely transparent and 100 completely opaque. The default value is 100.
(Inherited from PageGraphicElement)
Public propertyUpdateFieldsGets or sets whether the document's fields are updated before it is drawn. The default value is true.
Public propertyWidthGets or sets the width, in points; -1 for the room left on the page.
Public propertyXGets or sets the X position, in points.
Public propertyYGets or sets the Y position, in points.
Top
Methods
 NameDescription
Public methodRotate Rotates the coordinate system axes clockwise by the specified angle before rendering the element. The coordinates of the element are relative to the rotated coordinates system.
(Inherited from PageGraphicElement)
Public methodScale Scales the coordinates so that 1 unit in the horizontal and vertical dimensions of the new coordinate system is the same size as sx and sy units, respectively, in the previous coordinate system.
(Inherited from PageGraphicElement)
Public methodSkew Skews the x axis by an skewXAngle and the y axis by an skewYAngle before rendering the element.
(Inherited from PageGraphicElement)
Public methodTranslate Translates the coordinate system before rendering the element. The coordinates of the element are relative to the translated coordinate system.
(Inherited from PageGraphicElement)
Top
Remarks

With an automatic height (-1, the default) the document flows from the element's position onto the pages that follow, adding pages when the document has none left; with a fixed height it is drawn in that box and continues on the next pages until that much height is drawn. The width defaults to the room left on the page. The document's own margins are not kept: its content fills the region.

Its links stay live and its headings become entries of the document outline (Bookmarks). PdfPagesRectangles reports where each slice was drawn. In a tagged document the region carries the Word document's structure when Tagged is set; in a template it must be decorative (Artifact).

Example
Document document = new Document();
PdfPage page = document.AddPage();
page.AddElement(new TextElement(0, 0, "Attached report", document.AddFont(StdFontBaseFamily.HelveticaBold)));
page.AddElement(new WordToPdfElement(0, 30, "report.docx"));
document.Save("result.pdf");
See Also