# How to edit XPS files?

XPS files are Microsoft's rival to Adobe's PDF format.

How to edit or create new XPS files in Ubuntu?!

Master PDF Editor provides you advanced functions for working with PDF and XPS formats:

• Create new PDF and XPS files or edit existing ones.
• Add and/or edit bookmarks in PDF files.
• Encrypt and/or protect PDF files using 128 bit encryption.
• Convert XPS files into PDF.
• Add PDF controls (like buttons, checkboxes, lists, etc.) into your PDFs.
• Import/export PDF pages into common graphical formats including BMP, JPG, PNG, and TIFF.
• Free PDF Editor on Linux ( for non-commercial use)

Ubuntu users can install Master PDF Editor by using Ubuntu Software Center(Old versions)

sudo apt-get install master-pdf-editor


Official source

The only solution that I'm aware of isn't great... Through Google Drive (Docs).

This is how I modify an XPS file :

1. open the XPS using the document viewer.
2. print the XPS in a file and choose SVG format.
3. open it with Inkscape (https://inkscape.org/en/).

You can then modify it, render a high-resolution PNG, etc.

To create one, I would print in a file and choose PostScript format, I think this is the closest to XPS.

Converting from XPS

The package libgxps-utils includes tools that can be used to convert XPS files to JPG, PNG, PDF, PS, and SVG.

Editing

At this point, users may use any method they are aware of to edit the converted files.

Converting (via PS) to XPS

There is an output driver xpswrite that comes with Ghostscript. In principle, it should be able to convert from any format gs can read, but the fonts of files I tested tended to become unreadable.

To get fonts to render properly in XPS, files need to first be converted to PS, independently of gs. For instance, PDF files can be converted to PS with pdftops. However, pdf2ps will not work because it is simply a script that calls gs.

pdftops input.pdf    # convert to ps first
gs -dNOPAUSE -dBATCH -sDEVICE=xpswrite -sOutputFile=output.xps input.ps


Viewing

Common PS/PDF viewers, such as Evince and Okular, can render XPS files for viewing.