<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  
  
  <channel>
    <title>chrisjrob: convert</title>
    <link>https://chrisjrob.com</link>
    <atom:link href="https://chrisjrob.com/tag/convert/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>Howto | Convert Quicktime MOV to AVI</title>
      <link>https://chrisjrob.com/2009/03/21/convert-quicktime-mov-to-avi/</link>
      <pubDate>Sat, 21 Mar 2009 05:57:44 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/21/convert-quicktime-mov-to-avi</guid>
      <description>
       <![CDATA[
         
         <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ ffmpeg -i "source.mov" -sameq -vcodec msmpeg4v2 -acodec pcm_u8 "output.avi"
</code></pre></div></div>

       ]]>
      </description>
    </item>
    
    <item>
      <title>Howto | Convert DVR-MS to MPEG</title>
      <link>https://chrisjrob.com/2009/03/10/convert-dvr-ms-to-mpeg/</link>
      <pubDate>Tue, 10 Mar 2009 22:02:23 +0000</pubDate>
      <author>chrisjrob@gmail.com (Chris Roberts)</author>
      <guid>https://chrisjrob.com/2009/03/10/convert-dvr-ms-to-mpeg</guid>
      <description>
       <![CDATA[
         
         <h2 id="simple-bash-script-to-convert-all-dvr-ms-files-in-a-directory">Simple bash script to convert all dvr-ms files in a directory</h2>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#! /bin/bash</span>
<span class="k">for </span>a <span class="k">in</span> <span class="k">*</span>.dvr-ms<span class="p">;</span> <span class="k">do
    if</span> <span class="o">[</span> <span class="nt">-f</span> <span class="s2">"</span><span class="nv">$a</span><span class="s2">"</span> <span class="o">]</span><span class="p">;</span> <span class="k">then
        </span><span class="nv">b</span><span class="o">=</span><span class="s2">"</span><span class="k">${</span><span class="nv">a</span><span class="p">%.dvr-ms</span><span class="k">}</span><span class="s2">"</span>
        ffmpeg <span class="nt">-i</span> <span class="s2">"</span><span class="nv">$a</span><span class="s2">"</span> <span class="nt">-vcodec</span> copy <span class="nt">-acodec</span> copy <span class="s2">"</span><span class="k">${</span><span class="nv">b</span><span class="k">}</span><span class="s2">.mpg"</span>
    <span class="k">fi
done</span>
</code></pre></div></div>

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