Visio in XPS and Interesting Microsoft Office Labs Projects

For the past two years, I have been adding XAML-based projects to my collection, alongside the normal Visio libraries and automation code that I normally produce.  The reason is quite simple : both environments have the ability of linking vector graphics and data together in an exciting, interactive and controllable way.  There is a certain smartness to both with the ability to binding data to graphical appearance.  XAML seems to be present in all of Microsoft’s graphic products, in the form of WPF, Silverlight .and Xps.  Now, we know that there are great things to come viz-a-viz Visio and XAML in the next version, and there is Saveen Reddy,s excellent Visio Export to XAML project on CodePlex (, but most people do not realise that Xps is XAML, but compressed.

So, if you have Visio 2007, then you can save a document in Xps format ( see


This should open in your browser, like this:


However, Microsoft have a standalone Xps viewer available for free download as part of the Xps Essentials Pack ( ).

The XPS Viewer EP includes a thumbnail viewer, which will create an interactive canvas, in which you can select which page to zoom into.


The Xps Viewer EP also includes a document outliner, but this reveals a bug in the Xps file exported from Visio when you click on a page.


Fortunately, it is possible to fix this error.


The error can be traced to the Documents1StructureDocStructure.struct file:

  <DocumentOutline xml:lang="en-US">
   <OutlineEntry OutlineLevel="1" Description="NetworkTopology.vsd"  OutlineTarget="../FixedDoc.fdoc#1"/>
   <OutlineEntry OutlineLevel="2" Description="Topology"  OutlineTarget="../FixedDoc.fdoc#1"/>
   <OutlineEntry OutlineLevel="2" Description="Row 1 Rack 1"  OutlineTarget="../FixedDoc.fdoc#2"/>
   <OutlineEntry OutlineLevel="2" Description="Row 1 Rack 2"  OutlineTarget="../FixedDoc.fdoc#3"/>
<Story StoryName="MainStory">
  <StoryFragmentReference Page="1"/>
  <StoryFragmentReference Page="2"/>
  <StoryFragmentReference Page="3"/>

which should become:

<DocumentStructure xmlns="" xmlns:c="" xmlns:b="" c:Ignorable="b">
  <DocumentOutline xml:lang="en-US">
   <OutlineEntry OutlineLevel="1" Description="NetworkTopology.vsd" OutlineTarget="../FixedDoc.fdoc#PG_0" />
   <OutlineEntry OutlineLevel="2" Description="Topology" OutlineTarget="../FixedDoc.fdoc#PG_0" />
   <OutlineEntry OutlineLevel="2" Description="Row 1 Rack 1" OutlineTarget="../FixedDoc.fdoc#PG_4" />
   <OutlineEntry OutlineLevel="2" Description="Row 1 Rack 2" OutlineTarget="../FixedDoc.fdoc#PG_5" />
<Story StoryName="MainStory">
  <StoryFragmentReference Page="1" />
  <StoryFragmentReference Page="2" />
  <StoryFragmentReference Page="3" />

Note the amended OutlineTarget attributes

… and to the Documents1FixedDoc.fdoc file:

<FixedDocument xmlns="">
<PageContent Source="Pages/1.fpage"></PageContent>
<PageContent Source="Pages/2.fpage"></PageContent>
<PageContent Source="Pages/3.fpage"></PageContent>

should become :

<FixedDocument xmlns="">
<PageContent Source="Pages/1.fpage" Width="1124" Height="795">
<PageContent.LinkTargets><LinkTarget Name="PG_0" /></PageContent.LinkTargets></PageContent>
<PageContent Source="Pages/2.fpage" Width="1124" Height="795">
<PageContent.LinkTargets><LinkTarget Name="PG_4" /></PageContent.LinkTargets></PageContent>
<PageContent Source="Pages/3.fpage" Width="1124" Height="795">
<PageContent.LinkTargets><LinkTarget Name="PG_5" /></PageContent.LinkTargets></PageContent>

Note the added LinkTarget elements.

It is possible to go further, and to include significant shapes as named XAML elements in the XPS file, which means that you can expand the pages in the XPS viewer to list the shapes:


In fact, you can encapsulate the shape data (custom properties) as hidden elements in the Xps document, so that you could have your own viewer (say, WPF or Silverlight) that accesses the hidden elements.

In this way, Xps documents can become portable data diagrams, and they can be ready to print … unlike the Save As Web from Visio.

Now, the reason why I got back on to this subject recently was some great add-ons for OneNote and PowerPoint which (I think) use Xps in a manner similar to the Xps Viewer:

Canvas for OneNote –

pptPlex –

So, this is a public call for Microsoft Office Labs to consider a similar tool for Visio!  It would be really cool … and useful!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.


O365 and SharePoint

Simplify Tasks

Want to learn the simple way?

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, SQL Server BI, Data Modeling, SSAS Design, Power Pivot, Power BI, SSRS Advanced Design, Power BI, Dashboards & Visualization since 2009

John Goldsmith's visLog

be smart, be clear, be visual ...

Mo's blog

Personal views on Dynamics 365 for Operations and Technical Architecture.

Chris Webb's BI Blog

Microsoft Power BI, Analysis Services, MDX, DAX, M, Power Pivot and Power Query

Azure Solutions for Office 365, and more...

Rob Fahrni



Life with Visio and other Microsoft Toys!

Nilsandrey's Weblog

Just another weblog

Things that Should be Easy

Every so often (too often in the IT industry) I encounter things that should have been very easy to do but turned out to be far too complicated. My favorite topics include SharePoint, .Net development, and software architecture, especially distributed systems.

Visio Guy

Smart graphics for visual people

%d bloggers like this: