You can easily use «SautinSoft.Document» in .NET Core 2.0, 2.1 or higher. It's completely written in C# managed code and compiled under .NET Framework and .NET Core.
Let us say, you have just created a .NET Core project. To configure SautinSoft.Document in your project, make these steps:
Вы можете добавить ссылку на SautinSoft.Document сборка двумя способами:
1. Nuget (быстрый способ):
2. Старый добрый способ, добавив ссылку:
Примечание:
SautinSoft.Document.dll скомпилированный для .NET Core находится внутри(document_net.zip->SautinSoft.Document X.X\Bin\.NET Core X.X) папки.
SautinSoft.Document.dll скомпилирован для .NET Framework находится внутри (document_net.zip->SautinSoft.Document X.X\Bin\.NET Framework X.X) папки.
If you have added the SautinSoft.Document.dll into your project in previous step 1 through Nuget, all dependencies are already installed automatically and therefore simply skip this step.
In case of you have added the reference to the SautinSoft.Document.dll by the old way (Solution Explorer->right click by "References"->Add Reference...), please add these dependencies using Nuget:
For example, to add "System.IO.Packaging, 4.4.0:
Полный код
using SautinSoft.Document;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
ExampleHelloWorld();
}
/// <summary>
/// Create file with Hello World.
/// </summary>
/// <remarks>
/// Details: https://sautinsoft.com/products/document/help/net/developer-guide/using-in-netcore.php
/// </remarks>
static void ExampleHelloWorld()
{
DocumentCore dc = new DocumentCore();
dc.Content.End.Insert("Hello World!", new CharacterFormat() { FontName = "Verdana", Size = 65.5d,FontColor = Color.DarkBlue });
// Save a document to a file in DOCX format.
string filePath = @"Result.docx";
dc.Save(filePath);
// Open the result for demonstration purposes.
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(filePath) { UseShellExecute = true });
}
}
}
Imports System
Imports System.IO
Imports SautinSoft.Document
Module Sample
Sub Main()
ExampleHelloWorld()
End Sub
''' <summary>
''' Create file with Hello World.
''' </summary>
''' <remarks>
''' Details: https://sautinsoft.com/products/document/help/net/developer-guide/using-in-netcore.php
''' </remarks>
Sub ExampleHelloWorld()
Dim dc As New DocumentCore()
dc.Content.End.Insert("Hello World!", New CharacterFormat() With {
.FontName = "Verdana",
.Size = 65.5R,
.FontColor = Color.DarkBlue
})
' Save a document to a file in DOCX format.
Dim filePath As String = "Result.docx"
dc.Save(filePath)
' Open the result for demonstration purposes.
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(filePath) With {.UseShellExecute = True})
End Sub
End Module
Если вам нужен пример кода или у вас есть вопрос: напишите нам по адресу support@sautinsoft.com или спросите в онлайн-чате (правый нижний угол этой страницы) или используйте форму ниже: