Search Through XPS and OXPS Files

XPS (XML Paper Specification) and OXPS (Open XML Paper Specification) are two variations of the same file format. Windows Vista and later use this format to spool printed pages to the printer driver. Windows Vista and later also include a printer driver that saves your printout as an XPS or OXPS file to disk.

These files are technically ZIP archives that contain XML and assorted files. The actual content is stored as drawing calls for printers. Text is stored as series of glyph indices rather than as readable text. These glyhps are annotated with the text they're supposed to render. PowerGREP can extract these text annotations from XPS and OXPS files and arrange them correctly to reconstruct the text on the page.

To enable this, you need to set the "file formats to convert plain text with" on the File Selector panel to a configuration that uses the option "Use PowerGREP's built-in decoder to convert files to plain text" for the file format "XML Paper Specification (XPS and OXPS)". Default configurations that use this option are "proprietary formats", "all formats", "attachments & proprietary formats", and "attachments & all formats".

With one of these configurations selected on the File Selector panel, you can use the Editor|Open menu item to open an XPS or OXPS file and view it in PowerGREP's built-in editor. You won't be able to edit the file. You can edit its plain text representation if you first use File|Save As to save it as a plain text file.

If you want to search only through XPS and OXPS files, enter the file mask *.xps;*.oxps in the "include files" box on the File Selector panel. If you leave the "include files" and "exclude files" boxes blank, then PowerGREP searches through the plain text conversion of all file formats enabled by the configuration, as well as through the raw contents of all files that are not recognized as one of those file formats.

This file selection is available in the PowerGREP5.pgl library as "Office: Search through XPS and OXPS files".

The XPS format is designed to store final printouts. It is not designed to be editable. XPS files only provide text annotations to make them searchable. Modifying those annotations does not change the text shown on a printout or in an XPS viewer. Because of all this, PowerGREP cannot make replacements in XPS files.

If you want to look at or search through the raw XML inside XPS files, set select the "compound documents" file format configuration. But this is unlikely to give you good results, unless you really know your way around the XML format used by XPS files.