GNOME Bugzilla – Bug 670895
"Error creating XPS file: Source _rels/.rels not found in archive"
Last modified: 2017-09-06 19:50:40 UTC
Created attachment 208495 [details] xps files, examples that do not work I'm trying to convert an xps file to one of the supported output formats, but it doesn't work. $ xpstopdf lorem-ipsum-and-image.xps out.pdf Error creating XPS file: Source _rels/.rels not found in archive $ xpstopng lorem-ipsum-and-image.xps out.png Error creating XPS file: Source _rels/.rels not found in archive $ xpstops lorem-ipsum-and-image.xps out.ps Error creating XPS file: Source _rels/.rels not found in archive The xps documents were created with Microsoft XPS Document Writer (virtual printer) on Windows 7. They open file using XPS viewer on Windows.
> They open file using XPS viewer on Windows. They open fine [...] Also, if it matters, the installed version is a debian package I created I want to submit to Debian. The contents of the packages (if it matters): $ dpkg -L libgxps2 libgxps-utils /. /usr /usr/lib /usr/lib/libgxps.so.2.1.0 /usr/share /usr/share/doc /usr/share/doc/libgxps2 /usr/share/doc/libgxps2/copyright /usr/share/doc/libgxps2/AUTHORS /usr/share/doc/libgxps2/TODO /usr/share/doc/libgxps2/NEWS.gz /usr/share/doc/libgxps2/changelog.gz /usr/share/doc/libgxps2/changelog.Debian.gz /usr/share/doc/libgxps2/README /usr/lib/libgxps.so.2 /. /usr /usr/share /usr/share/man /usr/share/man/man1 /usr/share/man/man1/xpstops.1.gz /usr/share/man/man1/xpstosvg.1.gz /usr/share/man/man1/xpstopng.1.gz /usr/share/man/man1/xpstopdf.1.gz /usr/share/man/man1/xpstojpeg.1.gz /usr/share/doc /usr/share/doc/libgxps-utils /usr/share/doc/libgxps-utils/copyright /usr/share/doc/libgxps-utils/AUTHORS /usr/share/doc/libgxps-utils/TODO /usr/share/doc/libgxps-utils/NEWS.gz /usr/share/doc/libgxps-utils/changelog.gz /usr/share/doc/libgxps-utils/changelog.Debian.gz /usr/share/doc/libgxps-utils/README /usr/bin /usr/bin/xpstopng /usr/bin/xpstopdf /usr/bin/xpstosvg /usr/bin/xpstojpeg /usr/bin/xpstops (Sorry for the long post)
This is a issue in libarchive that has been fixed in 3.0. See libarchive issue tracker: <http://code.google.com/p/libarchive/issues/detail?id=152> A XPS document is a ZIP file. Prior to 3.0 libarchive could not read ZIP files where the file size information is missing. I believe Windows' built-in XPS document printer doesn't set the file size. You should link against libarchive3 or libarchive12 or whatever they are calling it. If not, some XPS documents will be unreadable. As a workaround, you could unzip and re-zip the XPS document to get the file sizes set correctly.
Indeed, it works. Fortunately, libarchive 3.x is in the debian repositories: http://packages.qa.debian.org/liba/libarchive.html I'll put 3.0.0 as the minimal version to avoid this problem. Thank you very much!!
LIBARCHIVE_REQUIRED=2.8.0(In reply to comment #2) > This is a issue in libarchive that has been fixed in 3.0. > See libarchive issue tracker: > <http://code.google.com/p/libarchive/issues/detail?id=152> Would it make sense to bump the configure check to LIBARCHIVE_REQUIRED=3.0 in configure.ac then?
I agree, setting back to unconfirmed
Actually, there is one more important bugfix that is not released yet: https://code.google.com/p/libarchive/issues/detail?id=226#c5 https://github.com/libarchive/libarchive/commit/f7cd53ca1eda0d08fc3b3876ed474321b9f70ac7 Perhaps the required version should be bumped when the new release includes this bugfix.
There are a lot of documents that are not affected by this bugs, so I'm not sure we should bump libarchive requirements.
Ni! I have xpstopdf linked to libarchive-3.0.3 and still experience this problem, or at least a very similar one. # ldd /usr/bin/xpstopdf | grep libarchive libarchive.so.12 => /usr/lib64/libarchive.so.12 (0x00007f2372ed0000) If I run 'xpstopdf file.xps', the program juts keeps running forever at 100% cpu. If I do the unzip+zip procedure, everything works fine with the regenerated archive. I can provide the file I'm trying to open privately, but can't post it here, just send me an e-mail if you want it. Hugs, ale
(In reply to comment #8) > I can provide the file I'm trying to open privately, but can't post it here, > just send me an e-mail if you want it. Actually, there's no need for that, the examples already provided by Savvas give the exact same problem I described. btw, I'm using libgxps-0.2.1 tx!
I described that bug in comment #6 :) The fix is in git upstream (libarchive). Origin: https://code.google.com/p/libarchive/issues/detail?id=226 Description: Fix issue 226 (infinite loop while using libgxps-utils). The patch is from this merge (adopted to match 3.0.3 release): https://github.com/libarchive/libarchive/commit/f7cd53ca1eda0d08fc3b3876ed474321b9f70ac7 I adopted the patch to match 3.0.3 release files: https://gist.github.com/1974141/ (uses quilt as a patch system)
(In reply to comment #10) > I described that bug in comment #6 :) The fix is in git upstream (libarchive). Oops I'm really sorry, completely overlooked that, should have followed the link :P > I adopted the patch to match 3.0.3 release files: > https://gist.github.com/1974141/ (uses quilt as a patch system) Thanks! Everything works now ;-) - and can wait for update in peace. One little "=" huh... and not easy to figure out. ale
I guess this can be marked as fixed.