| Author |
|
| Company |
GemBox Software |
| Source Code Available |
No |
| License Type |
Free to try |
| Submitted On |
July 16, 2012 |
| Updated on |
August 22, 2012 |
| .NET Framework |
2.0, 3.5 |
| Cost |
Free |
Description
GemBox.Document - C# / VB.NET Word component
for easy and efficient Word document processing in .NET without Microsoft Word.
GemBox.Document supports DOCX reading and writing and writing / creating PDF, XPS and image formats.
GemBox.Document advantages:
- Unified programming interface for multiple document formats (DOCX, PDF, XPS).
- Rich Set of Features.
- No dependency on Microsoft Word.
- Many times faster than Microsoft .NET Word automation.
- Plain and fair licensing.
- Simple and easy-to-use programming interface.
- Preserves unsupported file format features.
GemBox.Document common uses:
Syntax Example
// Create a new empty document.
DocumentModel document = new DocumentModel();
// Add document content.
document.Sections.Add(
new Section(document,
new Paragraph(document, "Hello World!")));
// By specifying a location that is under ASP.NET application's control,
// GemBox.Document can use file system operations to retrieve font data
// when exporting to PDF in Medium Trust environment.
FontSettings.FontsBaseDirectory = Server.MapPath("Fonts/");
Response.Clear();
// Microsoft Packaging API and PDF exporter cannot write directly
// to Response.OutputStream. Therefore we use temporary MemoryStream.
using (MemoryStream documentStream = new MemoryStream())
{
// Stream file to browser, in required type.
switch (formatRadioButtonList.SelectedValue)
{
case "DOCX":
document.Save(documentStream, SaveOptions.DocxDefault);
Response.ContentType = "application/vnd.openxmlformats";
Response.AddHeader("Content-Disposition",
"attachment; filename=Document.docx");
break;
case "PDF":
document.Save(documentStream, SaveOptions.PdfDefault);
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition",
"attachment; filename=Document.pdf");
break;
}
documentStream.WriteTo(Response.OutputStream);
}
Response.End();Screenshots
Reviews
Submit a review