.NET API for EPS, PostScript, and XPS File Processing

Transform your .NET apps by adding PostScript and XPS manipulation features using the Aspose XPS document API for .NET. Seamlessly add, edit, and convert pages, create vector graphic elements, and do much more.

Download Free TrialView All APIs

Empower .NET Solutions with XPS and PS Processing Features

Aspose.Page for .NET offers a comprehensive feature set to manage different page description elements on the .NET platform. It helps developers programmatically create, render, and convert XPS files and manipulate EPS and PostScript documents. Developers can create, add, and modify pages in XPS files, insert text and images into XPS and PostScript files, work with glyphs, canvas, and paths, manipulate vector graphic shape elements and text strings, and manage print tickets. It supports drawing shapes in PostScript documents and using solid color, image, and visual brushes.

The XPS file processing API for .NET boasts excellent conversion capabilities to convert XPS, EPS, and PostScript files to PDF documents and JPEG, PNG, BMP, and TIFF images, EMF, and WMF files. Users can upgrade their .NET page processing solutions by incorporating the supported conversion features for seamlessly converting XPS to PDF, PostScript to PDF, EPS to PDF, XPS to JPEG, PS to PNG, and more. Aspose.Page for .NET provides merging functionality to merge PostScript or XPS documents while also supporting cross-package operations.

Getting Started

Please review the following information for conveniently setting up Aspose.Page for .NET. The System Requirements page lists the prerequisites to ensure you have the recommended OS, development environment, and framework requirements enabled at your end before installing the PostScript and XPS file processing API.

Aspose.Page for .NET Installation

Please visit the downloads section to download the MSI installer or the DLLs to install the .NET page manipulation library. Or, you can utilize the NuGet package to set up the library in the Visual Studio Package Manager Console using the following command:

PM > Install-Package Aspose.Page

Insert Text in XPS and Effortlessly Convert XPS to PDF in .NET

Aspose.Page for .NET includes many options for manipulating different elements of page description language (PDL) formats such as PostScript, EPS, and XPS. It allows working with pages, text, and images, and users can build .NET solutions to insert text, images, and new pages into files of supported formats. It is one of the best .NET libraries for XPS to PDF conversion and lets users effortlessly convert PostScript and EPS documents to PDF and raster images.

How to Add Text in XPS Files in C#

As part of the XPS document generation, manipulation, and processing capabilities of Aspose.Page for .NET API, inserting text into XPS files is a prominent feature. In the following C# code example, we will review how to add text to XPS files quickly and easily, so let’s check the steps involved.

  • Create an XPSDocument class object.
  • Next, create a brush of a color of your choice.
  • Add a glyph to the file.
  • Save the XPS document using the Save method.
// Create a new XPS Document
XpsDocument doc = new XpsDocument();

// Create a brush 
XpsSolidColorBrush textFill = doc.CreateSolidColorBrush(Color.Black);

// Add glyph to the document
XpsGlyphs glyphs = doc.AddGlyphs("Arial", 12, FontStyle.Regular, 300f, 450f, "Hello World!");
glyphs.Fill = textFill;

// Save the resultant XPS document
doc.Save("AddText_out.xps");

How to convert XPS to PDF using C#

Developers can enjoy a full-cycle XPS document processing experience in .NET with the XPS library. They can convert XPS files to different formats within their .NET apps. The following steps and C# coding example explain how to convert XPS to PDF on the .NET platform with various save options.

  • Use a Stream class object to load the input XPS file.
  • Create a PdfSaveOptions class object to set the parameters.
  • For the output PDF file, create a rendering device.
  • Save the converted XPS file to PDF format.
// The path to the documents directory.
string dataDir = "C:\\TestFiles\\";

// Initialize PDF output stream
using (Stream pdfStream = File.Open(dataDir + "XPStoPDF.pdf", FileMode.Create, FileAccess.Write))
// Initialize XPS input stream
using (Stream xpsStream = File.Open(dataDir + "input.xps", FileMode.Open, FileAccess.Read))
{
    // Load XPS document form the stream
    XpsDocument document = new XpsDocument(xpsStream, new XpsLoadOptions());

    // Initialize options object with necessary parameters.
    PdfSaveOptions options = new PdfSaveOptions()
    {
        JpegQualityLevel = 100,
        ImageCompression = PdfImageCompression.Jpeg,
        TextCompression = PdfTextCompression.Flate,
        PageNumbers = new int[] { 1 }
    };

    // Create a rendering device for PDF format
    PdfDevice device = new PdfDevice(pdfStream);
    
    // Save the converted PDF document
    document.Save(device, options);
}

Please visit the GitHub examples page of Aspose.Page for .NET API to view more working code examples. If you are looking to view, convert, or sign EPS, PostScript, and XPS documents on the fly, please check our cross-platform Free Online XPS and PostScript Processing Apps today.

Efficient PostScript Rendering and Manipulation in .NET

Aspose.Page for .NET API is loaded with features that provide impeccable rendering and manipulation of the PostScript documents. The API supports working with a host of PostScript file elements such as shapes, images, gradients, textures, transparency, text, pages, and more. The advanced PostScript manipulation capability allows developers to augment their existing page processing solutions in .NET by efficiently integrating the PS document manipulation functionality or building new solutions from scratch.

FAQ

1. How can I convert XPS, EPS, and PS files on the .NET platform?

Converting these files in .NET is quick and easy using the EPS, PostScript, and XPS file processing API for .NET. It helps you seamlessly convert PS, EPS, and XPS files to PDF, JPEG, PNG, TIFF, BMP, EMF, WMF, and more.

2. How long it takes to process XPS and PostScript files and convert them?

The XPS document API works fast and completes your PostScript and XPS file reading, writing, converting, and processing requests in no time.

3. Is it safe to process PostScript and XPS documents using the .NET API?

You can be sure of the security of your data files while processing them using the PS file manipulation API. We ensure the privacy of your data and take all required measures to provide you with a secure user experience.

4. Can I process XPS data files on different operating systems?

Yes, the .NET XPS library works across different OS, frameworks, and operating environments. You can use it on the platform of your choice & it does not require any additional software installation to function.

Looking for help?

Checkout our support channels for help with your questions related to Aspose product API features and working.

Ready to get started?

Download Free Trial View All APIs