|
1 | 1 | ### What is WebFormsDocumentViewer? |
2 | | -WebFormsDocumentViewer is a simple custom control that lets you embed documents (PDF, Word, PowerPoint and Excel) in your ASP.NET WebForms pages. |
| 2 | +WebFormsDocumentViewer is a simple custom control that lets you embed documents (PDF, Word, PowerPoint, Excel and RichTextFormat) in your ASP.NET WebForms pages. |
3 | 3 |
|
4 | 4 | ### How do I get started? |
5 | 5 | First, add a reference in your web.config to the WebFormsDocumentViewer assembly: |
@@ -33,7 +33,7 @@ You can configure the following parameters of the viewer: |
33 | 33 | * Width: sets the width of the iframe |
34 | 34 | * Height: sets the height of the iframe |
35 | 35 | * FilePath: path to the file to be render on the HTML page |
36 | | -* TempDirectoryPath: path for the temporary converted to PDF files (see Word, PowerPoint and Excel sections below). |
| 36 | +* TempDirectoryPath: path for the temporary converted to PDF files (see Word, PowerPoint, Excel and RichTextFormat sections below). |
37 | 37 | * PdfRenderer: is used by documents converted to PDFs (see below) and you can choose between [PDF.js](https://mozilla.github.io/pdf.js/) and [Adobe Reader](https://acrobat.adobe.com/uk/en/). Adobe Reader is used by default now, but this requires Adobe to be installed client-side. PDF.js is relying only on JavaScript, but the library is still developing. For further information check their websites. |
38 | 38 |
|
39 | 39 | ### How to embed PDF documents? |
@@ -79,6 +79,18 @@ You can embed an Excel document as shown below: |
79 | 79 | If TempDirectoryPath is not supplied, the converted documents can be found in the Temp directory of the project root. |
80 | 80 | You can additionally set the PdfRenderer parameter if you want to use PDF.js. |
81 | 81 |
|
| 82 | +### How to embed RichTextFormat documents? |
| 83 | +RichTextFormat documents are converted to PDF documents, then rendered in iframe. You should have Microsoft Office installed on the server for this to work. |
| 84 | +You can embed a RichTextFormat document as shown below: |
| 85 | + |
| 86 | +```html |
| 87 | +<cc:DocumentViewer runat="server" Width="500" Height="500" FilePath="sample.rtf" TempDirectoryPath="~/TempFiles" PdfRenderer="PdfJs" /> |
| 88 | +``` |
| 89 | + |
| 90 | +If TempDirectoryPath is not supplied, the converted documents can be found in the Temp directory of the project root. |
| 91 | +If PdfRenderer is not supplied, Adobe Reader is used by default. |
| 92 | + |
| 93 | + |
82 | 94 | ### Do you have an issue? |
83 | 95 | Have a bug or a feature request? Please search for existing and closed issues before submitting a new one. If your problem or idea is not addressed yet, please open a new issue. |
84 | 96 |
|
|
0 commit comments