Aspose.Page 22.7.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Aspose.Page --version 22.7.0
NuGet\Install-Package Aspose.Page -Version 22.7.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspose.Page" Version="22.7.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Aspose.Page --version 22.7.0
#r "nuget: Aspose.Page, 22.7.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Aspose.Page as a Cake Addin
#addin nuget:?package=Aspose.Page&version=22.7.0

// Install Aspose.Page as a Cake Tool
#tool nuget:?package=Aspose.Page&version=22.7.0

Convert XPS to Image Set Image Size via .NET API

Version 22.7.0 Nuget

banner

Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

Aspose.Page for .NET is an on premise .NET API that allows you to add XPS manipulation features to your own applications. The API also supports converting XPS, EPS & PS documents to other formats.

Developers can perform various operations on XPS documents, such as, add text, images, pages, gradient, grid using the visual brush, transparency object and set opacity mask. It allows you to create, edit and convert the file pages as well as the ability to manipulate documents and elements, create vector graphics, group shapes, and specifying colors in different color spaces including sRGB, scRGB, and any space-based on ICC profile.

XPS, EPS & PS Processing Features

  • Create & modify XPS documents via API.
  • Add pages to XPS documents.
  • Create vector graphic shapes (Path element) and text strings (Glyphs element).
  • Group various elements as well as modify the appearance of text strings and graphics.
  • Support for visual brush, image brush, solid color brush, and more.
  • Work with multiple documents within an XPS document.
  • Preserve print tickets and add default print tickets to new XPS documents.
  • Perform cross-package operations such as inserting a page from another document.
  • Conversion of XPS, PS & EPS documents to other popular formats.
  • Supports PostScript language levels 1-3 with an exception of font types: Type2 (CFF), Type14 (Chameleon), Types 9, 10, 11, 32 (CID-Keyed).

What's new in v22.7.0

Convert XPS to Image Formats

Convert XPS to image formats with option to set the required image size. Supports XPS conversion to BMP, JPG, PNG, and TIFF raster image formats. The following is XPS to PNG converter C# code that uses the XPS processing API:

// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_WorkingWithDocumentConversion();
// Input file
string inputFileName = dataDir + "input.xps";
//Outut file 
string outputFileName = dataDir + "XPStoImage_out.png";
// Initialize XPS input stream
using (Stream xpsStream = File.Open(inputFileName, FileMode.Open, FileAccess.Read))
{
    // Load XPS document form the stream
    XpsDocument document = new XpsDocument(xpsStream, new XpsLoadOptions());
    // or load XPS document directly from file. No xpsStream is needed then.
    // XpsDocument document = new XpsDocument(inputFileName, new XpsLoadOptions());

    // Initialize options object with necessary parameters.
    PngSaveOptions options = new PngSaveOptions()
    {
        SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality,
        Resolution = 300,
        PageNumbers = new int[] { 1, 2, 6 }
    };

    // Create rendering device for image
    ImageDevice device = new ImageDevice();

    document.Save(device, options);

    // Iterate through document partitions (fixed documents, in XPS terms)
    for (int i = 0; i < device.Result.Length; i++)
        // Iterate through partition pages
        for (int j = 0; j < device.Result[i].Length; j++)
        {
            // Initialize image output stream
            using (Stream imageStream = System.IO.File.Open(Path.GetDirectoryName(outputFileName) +
                Path.GetFileNameWithoutExtension(outputFileName) + "_" + (i + 1) + "_" + (j + 1) +
                Path.GetExtension(outputFileName), System.IO.FileMode.Create, System.IO.FileAccess.Write))
                // Write image
                imageStream.Write(device.Result[i][j], 0, device.Result[i][j].Length);
        }
}

For a complete list of features, enhancements, and bug fixes in this release please visit, Aspose.Page for .NET 22.7 Release Notes.

Supported Read Formats

XPS, EPS, PS

Save XPS Documents As

Fixed Layout: PDF
Image: BMP, TIFF, JPEG, PNG

Save PS & EPS Documents As

Metafiles: EMF, WMF
Animation: GIF
Image: BMP, TIFF, JPEG, PNG

Platform Independence

Aspose.Page for .NET can be integrated with any kind of ASP.NET Web Application or a Windows Application.

Get Started

Are you ready to give Aspose.Page for .NET a try? Simply execute Install-Package Aspose.Page from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.Page for .NET and want to upgrade the version, please execute Update-Package Aspose.Page to get the latest version.

Create an XPS Document from Scratch via C# Code

Execute the below code snippet to see how Aspose.Page API performs in your own environment or check the GitHub Repository for other common usage scenarios.

// create XPS document
XpsDocument xDocs = new XpsDocument();
// add glyph to the document
var glyphs = xDocs.AddGlyphs("Arial", 12, FontStyle.Regular, 300f, 450f, "Hello World!");
glyphs.Fill = xDocs.CreateSolidColorBrush(Color.Black);
// save result
xDocs.Save(dir + "output.xps");

Convert a PostScript (PS) File to PDF Format

Aspose.Page for .NET allows you to work with document conversion, such as; PS to images, PS to PDF, XPS to images, XPS to PDF and so on. The following snippet demonstrates the conversion of PS to PDF using streams:

// initialize PostScript input stream
var psStream = new System.IO.FileStream(dir + "template.ps", System.IO.FileMode.Open, System.IO.FileAccess.Read);
// initialize PDF output stream
var pdfStream = new System.IO.FileStream(dir + "output.pdf", System.IO.FileMode.Create, System.IO.FileAccess.Write);
// read PS file
var document = new PsDocument(psStream);
// create a device for output steram
var device = new PdfDevice(pdfStream);
try
{
    document.Save(device, options);
}
finally
{
    psStream.Close();
    pdfStream.Close();
}

Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net20 is compatible.  net35 is compatible.  net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Aspose.Page:

Package Downloads
Aspose.Total

Aspose.Total for .NET is the most complete package of all .NET file format APIs offered by Aspose. It empowers developers to create, edit, render, print and convert between a wide range of popular document formats within any .NET, C#, ASP.NET and VB.NET applications.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Aspose.Page:

Repository Stars
aspose-words/Aspose.Words-for-.NET
Aspose.Words for .NET examples, plugins and showcases
Version Downloads Last updated
24.3.0 0 3/29/2024
24.2.0 1,572 2/22/2024
24.1.0 1,773 1/24/2024
23.12.0 2,698 12/23/2023
23.11.0 3,441 11/29/2023
23.10.0 4,394 10/11/2023
23.9.0 4,855 9/18/2023
23.8.0 8,623 8/18/2023
23.7.0 6,256 7/14/2023
23.6.0 3,942 6/29/2023
23.5.0 8,660 5/24/2023
23.4.0 4,136 4/15/2023
23.3.0 9,104 3/17/2023
23.2.0 39,167 2/28/2023
23.1.0 4,112 1/31/2023
22.12.0 5,961 12/29/2022
22.11.0 9,983 11/23/2022
22.10.0 11,333 10/26/2022
22.9.0 7,693 9/21/2022
22.8.0 17,024 8/26/2022
22.7.0 5,753 7/14/2022
22.6.0 9,358 6/8/2022
22.5.0 8,979 5/19/2022
22.4.0 15,242 4/21/2022
22.2.0 18,304 2/16/2022
21.12.0 25,991 12/22/2021
21.11.0 11,903 11/24/2021
21.7.0 6,026 7/21/2021
21.6.0 7,243 6/22/2021
21.4.0 21,039 4/20/2021
21.2.0 11,635 2/24/2021
21.1.0 14,739 1/21/2021
20.11.0 24,251 11/12/2020
20.10.0 1,718 10/13/2020
20.9.0 1,668 10/12/2020
20.7.0 2,025 7/21/2020
20.6.0 2,108 6/19/2020
20.5.0 9,317 5/21/2020
20.4.0 5,017 4/14/2020
20.3.0 1,625 3/23/2020
20.1.0 3,373 1/23/2020
19.12.0 3,685 12/17/2019
19.11.0 700 11/13/2019
19.10.0 692 10/16/2019
19.9.0 11,015 9/12/2019
19.8.0 684 8/16/2019
19.7.0 619 7/29/2019
19.6.0 797 7/3/2019