Word |
The WordToPdfArea type exposes the following members.
| Name | Description | |
|---|---|---|
| WordToPdfArea(Stream) | Creates an area that shows a Word document read from a stream, filling the band from its top left corner. | |
| WordToPdfArea(String) | Creates an area that shows a Word file, filling the band from its top left corner. | |
| WordToPdfArea(Single, Single, Stream) | Creates an area that shows a Word document read from a stream at a position in the band. | |
| WordToPdfArea(Single, Single, String) | Creates an area that shows a Word file at a position in the band, to its right edge and bottom. | |
| WordToPdfArea(Single, Single, Single, Single, Stream) | Creates an area that shows a Word document read from a stream in a rectangle of the band. | |
| WordToPdfArea(Single, Single, Single, Single, String) | Creates an area that shows a Word file in a rectangle of the band. |
| Name | Description | |
|---|---|---|
| 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. | |
| EmbedCompleteFonts | Gets or sets whether whole fonts are embedded rather than the characters used. The default value is false. | |
| Format | 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. | |
| Height | Gets or sets the height of the area, in points; 0 or less reaches the bottom of the band. | |
| InternalLinksEnabled | Gets or sets whether the document's links to places in itself are live. The default value is true. | |
| LiveUrlsEnabled | Gets or sets whether the document's web links are live in the area. The default value is true. | |
| OptimizeIdenticalImages | Gets or sets whether identical pictures are stored once. The default value is true. | |
| PageRanges | Gets or sets the page of the rendered document the area shows, for example "2". The default is the first page. | |
| Password | Gets or sets the password that opens an encrypted Word document. | |
| UpdateFields | Gets or sets whether the document's fields (dates, page numbers) are updated before it is drawn. The default value is true. | |
| Width | Gets or sets the width of the area, in points; 0 or less reaches the right edge of the band. | |
| X | Gets or sets the X position of the area in the band, in points. | |
| Y | Gets or sets the Y position of the area in the band, in points. |
Add it to the header or footer of the HTML to PDF converter with AddWordToPdfArea(WordToPdfArea) / AddWordToPdfArea(WordToPdfArea), or set it as the WordToPdfArea of the Word to PDF converter's header or footer options. The document's own margins are not kept: the content fills the area, scaled to its width and cut at its height.
Every format the Word to PDF converter reads is accepted: docx, docm, dotx, dotm, doc, dot, rtf, txt, WordML, html and markdown.
PdfConverter pdfConverter = new PdfConverter(); pdfConverter.PdfDocumentOptions.ShowHeader = true; pdfConverter.PdfHeaderOptions.HeaderHeight = 60; pdfConverter.PdfHeaderOptions.AddWordToPdfArea(new WordToPdfArea(0, 0, "letterhead.docx")); byte[] pdf = pdfConverter.GetPdfBytesFromUrl("https://www.html-to-pdf.info");