Tuesday, 22 October 2019 09:02

How to Mannually Add Spire.Doc as Dependency in a .NET Standard Library Project

Written by  support iceblue
Rate this item
(0 votes)

Step 1: Download the latest version of Spire.Doc Pack from the link below, unzip it, and you'll get the DLL files for .NET Standarad from the "netstandard2.0" folder. If you already have this folder in your disk, go straight to step two.

How to Mannually Add Spire.Doc as Dependency in a .NET Standard Library Project

Step 2: Create a .NET Standard library project in your Visual Studio.

How to Mannually Add Spire.Doc as Dependency in a .NET Standard Library Project

Step 3: Add all DLL files under the "netstandard2.0" folder as dependencies in your project.

Right-click "Dependencies" – select "Add Reference" – click "Browse" – selcet all DLLs under "netstandard2.0" folder – click "Add".

How to Mannually Add Spire.Doc as Dependency in a .NET Standard Library Project

Step 4: Install the other three packages in your project via the NuGet Package Manager. They are SkiaSharp, System.Text.Encoding.CodePages and System.Security.Cryptography.Xml.

Right-click "Dependencies" – select "Manage NuGet Packages" – click "Browse" – type the package name – select the package from the search results – click "Install".

How to Mannually Add Spire.Doc as Dependency in a .NET Standard Library Project

Step 5: Now that you've added all the dependences successfully, you can start to write your own .NET Standard library that is capable of creating and processing Word documents.

using Spire.Doc;
using Spire.Doc.Documents;

namespace SpireDocStandard
{
    public class Class1
    {
        public void CreateWord()
        {
            //Create a document object
            Document doc = new Document();

            //Add a section
            Section section = doc.AddSection();

            //Add a paragrah
            Paragraph paragraph = section.AddParagraph();

            //Append text to the paragraph
            paragraph.AppendText("Hello World");

            //Save to file
            doc.SaveToFile("Output.docx", FileFormat.Docx2013);
        }  
    }
}

Additional Info

  • tutorial_title: Mannually Add Spire.Doc as Dependency in a .NET Standard Library Project
Last modified on Tuesday, 22 October 2019 09:34