Developer Guide
Introduction
Welcome to the Aspose.Page for .NET Developer Guide. Aspose.Page is a powerful library designed to help developers work seamlessly with Electronic Document Formats (EDFs) such as XPS and PDF within .NET applications. Whether you’re creating, modifying, converting, or rendering documents, Aspose.Page provides a comprehensive set of features to meet your needs.
Key Features
Create and Edit Documents
Aspose.Page allows you to programmatically create new XPS and PDF documents or modify existing ones. You can add, remove, and update pages, annotations, bookmarks, and other document elements with ease.
Convert Between Formats
Easily convert documents between XPS and PDF formats. This functionality is essential for applications that require interoperability between different document standards.
Render Documents
Render pages of XPS and PDF documents to images in various formats such as PNG, JPEG, and BMP. This is particularly useful for generating thumbnails or preview images in applications.
Extract and Manipulate Content
Extract text, images, and other content from documents. Aspose.Page provides detailed access to document structures, enabling you to manipulate content programmatically.
Support for Advanced Features
Handle complex document elements like layers, hyperlinks, and digital signatures. Aspose.Page ensures that advanced document features are preserved and managed correctly during processing.
Optimize Performance
Designed for high performance, Aspose.Page efficiently handles large documents and high-volume processing tasks, making it suitable for enterprise-level applications.
Getting Started
To begin using Aspose.Page for .NET, install the package via NuGet:
Install-Package Aspose.Page
Ensure you have the .NET Framework or .NET Core installed in your development environment. After installation, you can start integrating Aspose.Page into your projects.
Code Example
Below is a simple example demonstrating how to convert an XPS document to PDF using Aspose.Page for .NET:
XpsConverter converter = new XpsConverter();
XpsConverterToPdfOptions opt = new XpsConverterToPdfOptions();
opt.AddDataSource(new FileDataSource("input.xps"));
opt.AddSaveDataSource(new FileDataSource("output.pdf"));
ResultContainer resultContainer = converter.Process(opt);
Explanation:
- Loading the XPS Document: The
XpsConverter
class is used to load the source XPS file. - Setting PDF Options:
XpsConverterToPdfOptions
allows you to specify settings for the output PDF. - Rendering and Saving: The
Process
method converts the XPS document to PDF and saves it to the specified path.
This example showcases the simplicity of converting documents using Aspose.Page. For more complex scenarios, such as manipulating document content or handling large files, refer to the detailed sections in this guide.
Empower your .NET applications with robust document processing capabilities using Aspose.Page. Dive into this developer guide to explore all the features and start building efficient document-centric solutions today.