How to Run Examples | Aspose.Page for .NET
Software Requirements
Please make sure you meet the following requirements before downloading and running the examples.
- Visual Studio 2017 or higher
- NuGet Package Manager installed in Visual Studio. Make sure that the latest NuGet API version is installed in Visual Studio. For details on how to install NuGet package manager please check https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools
- Go to Tools->Options->NuGet Package Manager->Package Sources and make sure that the option nuget.org is checked
- The example project uses NuGet Automatic Package Restore feature, therefore, you should have an active internet connection. If you do not have an active internet connection on the machine where examples are to be executed please check Installationand manually add the reference to Aspose.Page.dll in the example project.
Download from GitHub
All examples of Aspose.Page for .NET are hosted on GitHub.
- You can either clone the repository using your favourite GitHub client or download the ZIP file from here.
- Extract the contents of ZIP file to any folder on your computer. All the examples are located in the Examples folder.
- There are 3 solutions: Aspose.Page.Examples.CSharp.sln - for running in .NET Framework under Windows, Aspose.Page.Drawing.Core.3.1.Examples.CSharp.sln and Aspose.Page.Drawing.NET.7.Examples.CSharp.sln - for running in .NET Core and .NET 7 respectively under Windows or non-Windows operation systems like Linux or MacOS.
- You can open the first two solutions with Visual Studio 2019 or with Visual Studio 2017 SP1 and higher and the third one can be opened with Visual Studio 2022 or higher.
- Open the solution file in Visual Studio (or JetBrains Rider in Linux or MacOS) and build the project.
- On the first run, the dependencies will automatically be downloaded via NuGet.
- Data folder at the root folder of Examples contains input files which CSharp examples used. It is mandatory that you download the Data folder along with the examples project.
- Open RunExamples.cs file, all the examples are called from here.
- Uncomment the examples you want to run from within the project.
As you can see in the examples code in Aspose.Page.Drawing.Core.3.1.Examples.CSharp.sln and Aspose.Page.Drawing.NET.7.Examples.CSharp.sln VS solutions Aspose.Page.Drawing classes instead of System.Drawing ones are used. These classes are included in Aspose.Page.Drawing nuget package and serves as wrappers around Aspose.Drawing graphics backend instead of System.Drawing system library in Linux, MacOS and other non-Windows operation systems.
Please feel free to reach out using our Forums if you have any issues setting up or running the examples.
Contribute
If you like to add or improve an example, we encourage you to contribute to the project. All examples and showcase projects in this repository are open source and can be freely used in your own applications.
To contribute, you can fork the repository, edit the source code and create a pull request. We will review the changes and include it in the repository if found helpful.