Create XPS documents from scratch
C++ API solution to create and change XPS files.
Aspose.Page for C++ API solution lets you manipulate XPS files and other Page Description Language format files. The rich functionality allows adding different shapes to documents, merging a few files into a single one, or converting them to a more suitable format. In case you only start working with this format, here is described how to create new XPS files and modify (add glyphs to) the already existing ones. The code snippet is added for better understandability.
To create a new XPS file, we need:
Aspose.Page for C++ API, which is a feature-rich, powerful, and easy-to-use document manipulation and conversion API for C++ platform.
You can download its latest version directly, just open NuGet package manager, and search for Aspose.Page.Cpp and install. You may also use the following command from the Package Manager Console.
Package Manager Console Command
PM> Install-Package Aspose.Page.Cpp
Create an XPS file with C++
- Create a new XPS document using the MakeObject
function, which returns an object of the XpsDocument Class - Add a set of glyphs to the document using the AddGlyphs() Method of the XPS document object.
- Set the fill color of the text using the set_Fill Method, passing in a solid color brush created by the CreateSolidColorBrush Method of the XPS document object.
- Save the result XPS document to a file named output.xps in the directory specified by the dir variable.
Create XPS files
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.