Skip to main content

OnlyOffice Control for ASP.NET

Seamlessly integrate OnlyOffice Document Server into your ASP.NET Web Forms applications with full editing, viewing, and PDF conversion capabilities.

Quick Start

Get your OnlyOffice editor up and running in minutes

1

Add the control to your page

Register the OnlyOffice Editor control in your ASPX page and add it to your form:
<%@ Register Src="~/Controls/OnlyOfficeEditor/OnlyOfficeEditor.ascx" 
             TagPrefix="oo" TagName="Editor" %>

<oo:Editor ID="docEditor" runat="server" />
2

Configure the control

Set the required properties in your code-behind or inline:
docEditor.OnlyOfficeApiUrl = "https://your-onlyoffice-server/web-apps/apps/api/documents/api.js";
docEditor.JwtSecret = "your-jwt-secret";
docEditor.PublicBaseUrl = "https://your-app-url";
docEditor.Mode = "edit"; // or "view"
3

Load a document

Use one of the available methods to load a document into the editor:
// From uploaded file
if (fileUpload.HasFile)
{
    docEditor.SetDocumentFromBytes(
        fileUpload.FileBytes, 
        fileUpload.FileName
    );
}

// From server file
docEditor.SetDocumentFromFile(
    Server.MapPath("~/documents/sample.docx")
);
4

Handle document changes

Retrieve edited documents and convert to PDF if needed:
protected void btnDownload_Click(object sender, EventArgs e)
{
    // Get edited document
    byte[] documentBytes = docEditor.GetEditedDocumentBytes();
    
    // Or convert to PDF
    byte[] pdfBytes = docEditor.ConvertCurrentDocumentToPdfBytes();
    
    // Download
    Response.ContentType = "application/pdf";
    Response.AddHeader("Content-Disposition", "attachment; filename=document.pdf");
    Response.BinaryWrite(pdfBytes);
    Response.End();
}

Key Features

Everything you need to integrate document editing into your application

Document Editing

Full-featured document editor supporting Word, Excel, and PowerPoint formats

View Mode

Display documents in read-only mode with full formatting preservation

PDF Conversion

Convert any document to PDF with a single method call

JWT Security

Built-in JWT authentication for secure document operations

File Management

Upload, download, and manage documents with integrated handlers

JavaScript API

Client-side API for advanced editor customization and control

Ready to integrate document editing?

Add powerful document editing capabilities to your ASP.NET application in just a few minutes.

Start Installation

Build docs developers (and LLMs) love