Posted: . At: 11:13 PM. This was 4 years ago. Post ID: 14545
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


Convert an XPS file from Windows to a PDF file very easily.


The XPS document format is used by Windows to save a document when the document writer is used. The document reader in Ubuntu can open these just fine, but I wanted to be able to convert one to a PDF document. This is how I did it with the command line.

Install the libgxps-utils package with apt.

jason@jason-desktop:~$ sudo apt install libgxps-utils
[sudo] password for jason: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libllvm9
Use 'sudo apt autoremove' to remove it.
The following NEW packages will be installed:
  libgxps-utils
0 to upgrade, 1 to newly install, 0 to remove and 0 not to upgrade.
Need to get 30.5 kB of archives.
After this operation, 182 kB of additional disk space will be used.
Get:1 http://au.archive.ubuntu.com/ubuntu focal/universe amd64 libgxps-utils amd64 0.3.1-1 [30.5 kB]
Fetched 30.5 kB in 0s (62.9 kB/s)        
Selecting previously unselected package libgxps-utils.
(Reading database ... 369050 files and directories currently installed.)
Preparing to unpack .../libgxps-utils_0.3.1-1_amd64.deb ...
Unpacking libgxps-utils (0.3.1-1) ...
Setting up libgxps-utils (0.3.1-1) ...
Processing triggers for man-db (2.9.1-1) ...

Then run the xps2pdf command to convert the XPS format to a PDF.

jason@jason-desktop:~/Documents$ xpstopdf ivermectin.oxps

This is a very simple way to convert these files to PDF format using the Linux command line. This is very simple to do indeed. The resolution and DPI can be changed with command-line arguments, but this did not seem to make any difference when I used them. Just use the default command to convert as is. This works just fine.

To convert a PDF file to the DjVu file format, use this simple utility.

jason@jason-desktop:~/Documents$ pdf2djvu ivermectin.oxps.pdf -o ivermectin.djvu
ivermectin.oxps.pdf:
- page #1 -> #1
- page #2 -> #2
- page #3 -> #3
- page #4 -> #4
- page #5 -> #5
- Warning: metadata[CreationDate] is not a valid date
0.144 bits/pixel; 3.890:1, 74.29% saved, 2956110 bytes in, 759977 bytes out

The pdf2djvu utility is a perfect way to do this and provides a good quality conversion. Specifying the DPI value as 300 helps with the quality of the output.

jason@jason-desktop:~/Documents$ pdf2djvu ivermectin.oxps.pdf -o ivermectin.djvu --dpi=300
ivermectin.oxps.pdf:
- page #1 -> #1
- page #2 -> #2
- page #3 -> #3
- page #4 -> #4
- page #5 -> #5
- Warning: metadata[CreationDate] is not a valid date
0.144 bits/pixel; 3.890:1, 74.29% saved, 2956110 bytes in, 759977 bytes out

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.