How can I open an .xps file in Evince?

6,181

There is nothing wrong with what you are doing, the problem is that for Ubuntu 11.10 the necessary library to open .xps files was not included and at the moment there is no package for it.

This has apparently and possibly will be included by default in Ubuntu 12.04.

You can add support to convert .xps files in to another format tough. On the packager's PPA you can read

Note: The evince version in ubuntu 11.10 oneiric ocelot doesn't work with xps (segmentation fault when opening the file) and there are several packages to be backported. I've decided not to backport it. It works in ubuntu 12.04 precise pangolin. If you need to read an xps file, package libgxps-utils provides enough conversion tools, e.g. command: xpstopdf myfile.xps.

That means that you can add the PPA to your system and at least convert your .xps to another format that can be opened in your system.


To do that add the PPA to your system

sudo add-apt-repository ppa:medigeek/evince-xps

Update and install the necessary tools to convert your files

sudo apt-get update && sudo apt-get install libgxps-utils

You will then be able to convert your .xps files in to another format as described in the PPA description

xpstopdf foo_file.xps

will convert a file called foo_file.xps in to a .pdf file.


For more information on PPAs and how to use them please have a look at any of these 2 posts

Share:
6,181
Jakob
Author by

Jakob

Updated on September 18, 2022

Comments

  • Jakob
    Jakob almost 2 years

    On projects.gnome.org I read that evince/Document Viewer supports xps-files. But when I try to open an xps-file I get the error message

    Unable to open document
    File type Zip archive (application/zip) is not supported

    Reading "the full list of supported document formats" on live.gnome.org I can't find xps there.

    Now I ask myself (and you): Isn't Document Viewer able to open xps-files, or is there something wrong with that xps-file I try to open?

    I specifically want to do this with Ubuntu 11.10 Oneiric.


    I'd like to see a solution for Evince or Gnome in general, not get a recommendation for a KDE application like here.

    • nilsonneto
      nilsonneto over 12 years
      I'm interested if there is an answer - I've tried to recompile the latest evince under 11.10 - however the rerequisites breaks 11.10 (GTK, libpoppler etc) - therefore I'm doubtful that there is a 11.10 answer. Hope I'm wrong.
    • macrobook
      macrobook over 12 years
      If you have any problems with xpsto* command line tools, you should file a bug upstream to libgxps: bugzilla.gnome.org/browse.cgi?product=libgxps - I maintain the ppa, I will try to upload the new 0.2.2 version of libgxps, maybe that fixes your issue. My test files worked fine: bugs.launchpad.net/ubuntu/+source/libarchive/+bug/951139/…
    • nilsonneto
      nilsonneto over 12 years
      @medigeek - that really should be an answer!
    • Jakob
      Jakob over 12 years
      @medigeek You are right, your test files work fine! So it seems to be a problem of that xps I created from a strange pdf. I can't upload these files, but you can try it by yourself.
    • macrobook
      macrobook over 12 years
      @fossfreedom Bruno's answer is enough, I didn't add any new ideas, since there's pretty much only one way to do it. :) Jakob, So you're trying to convert a pdf to an xps and then back to pdf? If so, I think the pdf you posted uses a new version (1.7) which is not supported by many applications. For example, I cannot open that pdf in evince: bugs.launchpad.net/ubuntu/+source/poppler/+bug/321720
    • Jakob
      Jakob about 12 years
      @medigeek Thanks for the bug link - it looked exactly like this! When I saved the pdf I mentioned above it became saved with this stupid message ... That's why I "printed" an xps and then tried to re-convert to be usable in Ubuntu.
  • Bruno Pereira
    Bruno Pereira over 12 years
    @Jakob Lets hope a better answer comes from here, does a Use some other program answers look favorable to you?
  • Bruno Pereira
    Bruno Pereira over 12 years
    @Jakob Understood, just wondering if this would become a dupe of the one you linked or if posted as an answer it would be worthy of the bounty.