Cross-package operations within XPS Package
Manipulate pages, colors and glyphs within XPS Package via C++
Aspose.Page API for C++ offers a separate library for working with XPS files, allowing you to treat them as a distinct format. This library boasts a variety of useful features, including merging XPS documents, converting them to other formats, and manipulating graphics within them.
One key aspect of XPS files is their ability to contain multiple files within a single document. As a result, the Aspose.Page XPS library provides functionalities for managing these internal files and their pages. These operations, known as "cross-package operations," involve manipulating content across different XPS documents.
This section will delve into specific examples of cross-package operations, such as managing pages within a single XPS document and adding text (glyphs) with specific colors.
But to try the functionality you first need to get the solution:
Open the NuGet package manager, and search for Aspose.Page and install. You may also use the following command from the Package Manager Console.
Steps to manipulate pages within XPS Package C++.
- Set the path to the documents directory.
- Create an XPS file using the XpsDocument Class .
- To insert an active page from one document to the beginning of another document use the InsertPage() Method.
- To insert an active page from one document to the end of another document use the AddPage() Method.
- To remove an empty page use the RemovePage() Method.
- To remove a page from one document to another document use the InsertPage() and SelectActivePage() Methods.
- Save the changed XPS documents using the XPsDocument.Save Method.
Manipulate Pages
Steps to add a glyph clone within XPS Package C++.
- Set the path to the documents directory.
- Open a stream of the XPS file.
- Create an XPS file using the XpsDocument Class.
- Add glyphs to the document using the AddGlyphs() Method.
- Create the second XPS file using the XpsDocument Class.
- To clone the glyph from the first file to the second file, use the Add() and Clone() Methods.
- Save both XPS documents by means of the XPsDocument.Save() Method.
Add Glyph Clone And Change Color
Steps to add an image-filled Glyph C++.
- Set the path to the documents directory.
- Open a stream of the XPS file.
- Create an XPS file using the XpsDocument Class.
- Add glyphs to the document using the AddGlyphs() Method.
- To fill the glyphs with an image brush use the CreateImageBrush() Method.
- Create the second XPS file using the XpsDocument Class.
- Add glyphs with the font from the first document to the second document using the AddGlyphs() Method.
- Create an image brush from the fill of the first document and fill glyphs in the second document using the CreateImageBrush() Method.
- Save both XPS documents by means of the XPsDocument.Save() Method.
Add Image Filled Glyph And Foreign Image
XPS What is XPS File Format
XPS format is similar to PDF format. Both are page description language (PDL) formats. EPS is based on HTML and not on PostScript language. The .eps file is capable to contain a markup of the document's structure along with the information on how the document would look like. There are also added instructions on how to print and render the document. The feature of the format is that it fixes the document's description which means that it will look the same no matter who and from what operational system opens it.