Acesoft.Aceoffix
7.3.1.2
dotnet add package Acesoft.Aceoffix --version 7.3.1.2
NuGet\Install-Package Acesoft.Aceoffix -Version 7.3.1.2
<PackageReference Include="Acesoft.Aceoffix" Version="7.3.1.2" />
<PackageVersion Include="Acesoft.Aceoffix" Version="7.3.1.2" />
<PackageReference Include="Acesoft.Aceoffix" />
paket add Acesoft.Aceoffix --version 7.3.1.2
#r "nuget: Acesoft.Aceoffix, 7.3.1.2"
#:package Acesoft.Aceoffix@7.3.1.2
#addin nuget:?package=Acesoft.Aceoffix&version=7.3.1.2
#tool nuget:?package=Acesoft.Aceoffix&version=7.3.1.2
1. Introduction
Aceoffix For ASP.NET Core and does not cover the ASP.NET Framework. It supports .NET Core 3.1, as well as .NET 5 and later versions.Enables the embedding of Microsoft Office or WPS in web pages and provides functions such as online editing and saving of Office documents, access to document content, dynamic generation of document tables, control of editable areas, and submission of user input in Word/Excel.
2. How to integrate AceoffixV7 into your web project
Open this project using Visual Studio. Then right-click on the project folder, and click "Manage NuGet Packages → Browse" in sequence. Enter "Acesoft.Aceoffix" in the search box and install the latest version.
Download the Aceoffix client program.
Copy the program downloaded in the previous step to the root directory of your project. Then, in Visual Studio, right - click on the program and change the value of "Properties → Copy to Output Directory" to "Copy always".
Add the following code to your project
Program.csfile.builder.Services.AddAceoffixAcewServer();//Available starting from Aceoffix v7.3.1.1Add the following code to your project
Program.csfile.//Note: These two lines of code must be placed before app.UseRouting(). app.UseAceoffixAcewServer();//Available starting from Aceoffix v7.3.1.1 app.UseMiddleware<AceoffixNetCore.AceServer.ServerHandlerMiddleware>();Reference aceoffix.js in the <head> tag of the _Layout.cshtml page of your project.
<script type="text/javascript" src="aceoffix.js"></script>
Note: The path of aceoffix.js is relative to the root of your website.
Write the following link to pop up an Acebrowser window to edit Office document. We assume that the page which contains Aceoffix control is "Views/Home/Index.cshtml".
<a href="javascript:AceBrowser.openWindow('Word/Index', 'width=1150px;height=900px;');">Open Word File</a>
- Then, write the following server code in "Controllers/WordController.cs".
public IActionResult Index()
{
AceoffixNetCore.AceoffixCtrl aceCtrl= new AceoffixNetCore.AceoffixCtrl(Request);
aceCtrl.SaveFilePage = "Save";
aceCtrl.WebOpen("/doc/editword.docx", AceoffixNetCore.OpenModeType.docNormalEdit, "tom");
ViewBag.aceCtrl = aceCtrl.GetHtml();
return View();
}
- Add a new function called Save in "Controllers/WordController.cs" if your user wants to save document.
public async Task<ActionResult> Save()
{
AceoffixNetCore.FileSaver fs = new AceoffixNetCore.FileSaver(Request, Response);
await fs.LoadAsync();
string webRootPath = _webHostEnvironment.WebRootPath;
fs.SaveToFile(webRootPath + "/doc/" + fs.FileName);
return fs.Close();
}
- Please continue with the front-end code for the "Views/Word/Index.cshtml".
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript">
function SaveDoc() {
aceoffixctrl.WebSave();
}
function OnAceoffixCtrlInit() {
aceoffixctrl.AddCustomToolButton("Save", "SaveDoc()", 1);
}
</script>
</head>
<body>
<div style=" width:auto; height:98vh;">
@Html.Raw(ViewBag.aceCtrl)
</div>
</body>
</html>
- When publish the project , follow the prompts to install the Aceoffix V7 client. Once the registration dialog box appears, please enter the license key of Aceoffix V7 to complete the registration.
3. How to get more examples
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.1 is compatible. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.