Skip to content

Commit 782f0ba

Browse files
committed
Added text documents support
1 parent 59a4525 commit 782f0ba

File tree

6 files changed

+187
-4
lines changed

6 files changed

+187
-4
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### What is WebFormsDocumentViewer?
2-
WebFormsDocumentViewer is a simple custom control that lets you embed documents (PDF, Word, PowerPoint, Excel and RichTextFormat) in your ASP.NET WebForms pages.
2+
WebFormsDocumentViewer is a simple custom control that lets you embed documents (PDF, Word, PowerPoint, Excel, RichTextFormat and Text) in your ASP.NET WebForms pages.
33

44
### How do I get started?
55
First, add a reference in your web.config to the WebFormsDocumentViewer assembly:
@@ -90,6 +90,14 @@ You can embed a RichTextFormat document as shown below:
9090
If TempDirectoryPath is not supplied, the converted documents can be found in the Temp directory of the project root.
9191
If PdfRenderer is not supplied, Adobe Reader is used by default.
9292

93+
### How to embed Text documents?
94+
For Text documents, a simple iframe is generated, so the following line is enough to embed a document:
95+
96+
```html
97+
<cc:DocumentViewer runat="server" Width="500" Height="500" FilePath="~/sample.txt" />
98+
```
99+
100+
Other parameters are not required, as browsers support text documents by default.
93101

94102
### Do you have an issue?
95103
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.

WebFormsDocumentViewer.UI/Default.aspx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@
9090
</div>
9191
</div>
9292
</div>
93+
<div class="col col-md-6">
94+
<div class="card text-center">
95+
<div class="card-block">
96+
<h4 class="card-title">Text Viewer</h4>
97+
<p class="card-text">
98+
This renders a Text document in an iframe. No conversion is needed as browsers support
99+
this by default.
100+
</p>
101+
<cc:DocumentViewer runat="server" Width="100%" Height="500" FilePath="~/Samples/sample.txt" />
102+
</div>
103+
</div>
104+
</div>
93105
</div>
94106
</div>
95107
</form>

0 commit comments

Comments
 (0)