<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: xps</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/xps/feed/index.xml" rel="self" type="application/rss+xml" />
    <description>GNU Linux, Perl and FLOSS</description>
    <language>en-gb</language>
    <pubDate>Fri, 13 Feb 2026 17:22:31 +0000</pubDate>
    <lastBuildDate>Fri, 13 Feb 2026 17:22:31 +0000</lastBuildDate>
    
    <item>
      <title>Howto | Convert XPS to PDF</title>
      <link>https://chrisjrob.com/2013/03/12/convert-xps-to-pdf/</link>
      <pubDate>Tue, 12 Mar 2013 10:47:53 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2013/03/12/convert-xps-to-pdf</guid>
      <description>
       <![CDATA[
         
         <h2 id="introduction">Introduction</h2>

<p>XPS is Microsoft’s attempt to replace PDF, the only difference is that everyone can read PDFs, and not everyone can read XPS.  I understand that KDE 4 versions of Okular will support XPS, which may make these instructions unnecessary, although having a tool for conversion readily at hand is always useful!</p>

<!--more-->

<p>These instructions were tested in Debian Lenny.  These instructions worked for our specific systems YMMV.</p>

<h2 id="building-from-source">Building from source</h2>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ sudo apt-get install libxext-dev libxt-dev
$ wget http://ghostscript.com/releases/ghostpdl-8.71.tar.bz2
$ tar xvvjf ghostpdl-8.71.tar.bz2
$ cd ghostpdl-8.71
$ make xps
</code></pre></div></div>

<h2 id="testing">Testing</h2>

<p>After the build you will find gxps in xps/obj</p>

<p>To test, you will need a test document in XPS format.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ cd xps/obj
$ ./gxps -sDEVICE=pdfwrite -sOutputFile=test.pdf -dNOPAUSE test.xps
</code></pre></div></div>

<h2 id="move-to-bin">Move to bin</h2>

<p>You probably want to move the gxps executable into a convenient location within your PATH.  /usr/local/bin may be a good destination.  Once there you ought to be able to run the command from anywhere and it just work.  Not sure what your PATH is?  Type “echo $PATH” in your terminal.</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ echo $PATH
$ sudo cp xps/obj/gxps /usr/local/bin/
$ sudo chown root:root /usr/local/bin/gxps
</code></pre></div></div>

<h2 id="creating-file-type">Creating file type</h2>

<p>XPS probably does not exist on your Linux system as a file type, you can either create yourself using KDE Control Centre, or in KDE:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Single user:
~/.kde/share/mimelnk/application/xps.desktop

All users:
/usr/share/mimelnk/application/xps.desktop

[Desktop Entry]
Comment=XPS Document
Hidden=false
Icon=application-xps
MimeType=application/xps
Patterns=*.xps;*.XPS
Type=MimeType
X-KDE-AutoEmbed=false
</code></pre></div></div>

<h2 id="adding-to-servicemenu">Adding to ServiceMenu</h2>

<p>If you are using Konqueror, you can add a service menu (to enable right-click / action menu).</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Single user:
~/.kde/share/apps/konqueror/servicemenus/xpstopdf.desktop

All users:
/usr/share/apps/konqueror/servicemenus/xpstopdf.desktop

[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=xpstopdf service menu
ServiceTypes=application/xps
Icon=acroread
Actions=xpstopdf

[Desktop Action xpstopdf]
Icon=acroread
Name=Convert XPS to PDF
Exec=cd "%d"; gxps -sDEVICE=pdfwrite -sOutputFile="`echo "%f" | cut -d . -f 1`.pdf" -dNOPAUSE "%f"; mv "%f" ~/.local/share/Trash/files; kdialog --title "Convert XPS to PDF" --passivepopup "Done" 3; echo;
</code></pre></div></div>

<h2 id="testing-servicemenu">Testing ServiceMenu</h2>

<p>You should now be able to right-click on the file and “Convert XPS to PDF”.  This will create a PDF of the same name and move the XPS into trash.</p>

<h2 id="references">References</h2>

<ul>
  <li><a href="http://www.ghostscript.com/GhostPCL.html">http://www.ghostscript.com/GhostPCL.html</a></li>
  <li><a href="http://obscured.info/2010/03/01/converting-xps-to-pdf-on-ubuntu-9-10/">http://obscured.info/2010/03/01/converting-xps-to-pdf-on-ubuntu-9-10/</a></li>
  <li><a href="http://blog.rubypdf.com/2009/04/14/convert-xps-to-pdf-in-two-ways/">http://blog.rubypdf.com/2009/04/14/convert-xps-to-pdf-in-two-ways/</a></li>
</ul>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Microsoft XPS under Linux</title>
      <link>https://chrisjrob.com/2010/08/04/microsoft-xps-under-linux/</link>
      <pubDate>Wed, 04 Aug 2010 00:00:00 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2010/08/04/microsoft-xps-under-linux</guid>
      <description>
       <![CDATA[
         
         <p>A member of staff asked how he could open a personal XPS file, created in Windows 7.  Now XPS is the Microsoft replacement for PDF and it is apparently installed as a printer by default in Vista and Windows 7, which means increasingly people are going to start sending XPS files whether we like it or not.</p>

<!--more-->

<p>Fortunately it seems XPS is supported in Okular under KDE4 (which we don’t have yet), and can also be readily converted to PDF using the Ghostscript “gxps” tool.  This has to be built from source, but proved relatively simple.  As our users do not have access to the command line, I also had to also create a Konqueror service menu, to enable right-click Action “Convert XPS to PDF”.</p>

<p>I am pleased to say it all works beautifully, and I have typed up my instructions for Debian Lenny here:</p>

<ul>
  <li>
    <table>
      <tbody>
        <tr>
          <td>[Howto</td>
          <td>Convert XPS to PDF](/2013/03/12/convert-xps-to-pdf/)</td>
        </tr>
      </tbody>
    </table>
  </li>
</ul>

       ]]>
      </description>
    </item>
    
  </channel> 
</rss>
