GNOME Bugzilla – Bug 768117
Support for .oxps documents
Last modified: 2017-03-31 07:14:31 UTC
While I know that evince has support for .XPS documents (Thanks CarlosGarciaCampos), now certain documents are coming in the .OXPS format. (Thanks Win8/Win10 users! :-p hehe) When trying to open one of these documents in evince, you get the error: Unable to open document “file:///home/.../Diagram1.oxps". File type Zip archive (application/zip) is not supported. Yes, the document is compressed with the zip utility, and breaking out the compressed files in it gives something like: tech8 ~ $ unzip -l ~/.../20160623-Diagram1.oxps Archive: /home/.../Diagram1.oxps Length Date Time Name --------- ---------- ----- ---- 3679 06-23-2016 16:40 Metadata/Job_PT.xml 340 06-23-2016 16:40 Metadata/MXDC_Empty_PT.xml 2078 06-23-2016 16:40 Documents/1/Metadata/Page1_Thumbnail.JPG 163 06-23-2016 16:40 Documents/1/Resources/Images/1.PNG 935 06-23-2016 16:40 Documents/1/Resources/Images/2.PNG 20501 06-23-2016 16:40 Documents/1/Pages/1.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/1.fpage.rels 101707 06-23-2016 16:40 Documents/1/Pages/2.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/2.fpage.rels 41433 06-23-2016 16:40 Documents/1/Pages/3.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/3.fpage.rels 72685 06-23-2016 16:40 Documents/1/Pages/4.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/4.fpage.rels 79693 06-23-2016 16:40 Documents/1/Pages/5.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/5.fpage.rels 54227 06-23-2016 16:40 Documents/1/Pages/6.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/6.fpage.rels 52880 06-23-2016 16:40 Documents/1/Pages/7.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/7.fpage.rels 123698 06-23-2016 16:40 Documents/1/Pages/8.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/8.fpage.rels 31418 06-23-2016 16:40 Documents/1/Pages/9.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/9.fpage.rels 112578 06-23-2016 16:40 Documents/1/Pages/10.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/10.fpage.rels 44691 06-23-2016 16:40 Documents/1/Pages/11.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/11.fpage.rels 2620 06-23-2016 16:40 Documents/1/Pages/12.fpage 295 06-23-2016 16:40 Documents/1/Pages/_rels/12.fpage.rels 10703 06-23-2016 16:40 Documents/1/Pages/13.fpage 539 06-23-2016 16:40 Documents/1/Pages/_rels/13.fpage.rels 35027 06-23-2016 16:40 Documents/1/Pages/14.fpage 817 06-23-2016 16:40 Documents/1/Pages/_rels/14.fpage.rels 3828 06-23-2016 16:40 Documents/1/Pages/15.fpage 295 06-23-2016 16:40 Documents/1/Pages/_rels/15.fpage.rels 3936 06-23-2016 16:40 Resources/_D1.dict 268152 06-23-2016 16:40 Documents/1/Resources/Fonts/058BE574-2DB7-4982-9495-5D7A6C1D5847.odttf 250296 06-23-2016 16:40 Documents/1/Resources/Fonts/46033C7D-E563-43D6-A079-C473D8239235.odttf 690 06-23-2016 16:40 Documents/1/FixedDocument.fdoc 260 06-23-2016 16:40 Documents/1/_rels/FixedDocument.fdoc.rels 191 06-23-2016 16:40 FixedDocumentSequence.fdseq 247 06-23-2016 16:40 _rels/FixedDocumentSequence.fdseq.rels 424 06-23-2016 16:40 _rels/.rels 874 06-23-2016 16:40 [Content_Types].xml --------- ------- 1330887 44 files tech8 ~ $ So, would it be possible to get .oxps support in evince? Thanks.
I think this should be added in libgxps.
I'm not finding a summary of the differences between xps and oxps, but the most immediate change I've seen is that there is a new schema url.
Created attachment 348282 [details] [review] Support-OpenXPS-fixed-representation-schema.patch libgxps was failing with an error message, "Invalid XPS File: fixedrepresentation not found". It couldn't find the fixedrepresentation because it locates it based on schema and OXPS changes some schemas. This patch adds a check for the new schema.
Review of attachment 348282 [details] [review]: Thanks for the patch, is this the only change needed to support oxps? or are there more changes? Do you have a test file I can try? ::: libgxps/gxps-file.c @@ +115,3 @@ xps->priv->fixed_repr = g_strdup (target); + } else if (strcmp (type, REL_OXPS_FIXED_REPRESENTATION) == 0) { + xps->priv->fixed_repr = g_strdup (target); This looks good to me, but since it's setting the same thing fixed_repr, I would move the check to the previous if instead if (REL_FIXED_REPRESENTATION || REL_OXPS_FIXED_REPRESENTATION)
Created attachment 348965 [details] oxps example (bts.oxps) (In reply to Carlos Garcia Campos from comment #4) > Thanks for the patch, is this the only change needed to support oxps? or are > there more changes? Do you have a test file I can try? I created the attached oxps file from a Windows 8 laptop by printing a web page with the "Microsoft XPS Document Writer" printer. I found a link to the new specification: http://www.ecma-international.org/publications/standards/Ecma-388.htm. I think I found that via Wikipedia. There are a few other differences. It removes Windows Media Photo support, adds some 3D Graphic stuff, and changes schemas in several places, but libgxps mostly doesn't worry about schemas and doesn't support Windows Media Photo or 3D anyway. There may be other changes that I haven't noticed. That patch is enough to make the attached document work.
Created attachment 349027 [details] [review] Support-OpenXPS-fixed-representation-schema.patch updated version of patch
Comment on attachment 349027 [details] [review] Support-OpenXPS-fixed-representation-schema.patch Ok, pushed, thank you!