• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • Visio Shape Report Converter
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Using Visio in Education for GIS
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Visualize Complex Processes with Microsoft Visio
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Shape Design / Save As / Visio in XPS and Interesting Microsoft Office Labs Projects

Published on April 17, 2009 by David Parker

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 ( https://www.openhub.net/p/VisioExportToXAML ), 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.

image

This should open in your browser, like this:

image

However, Microsoft have a standalone Xps viewer available for free download as part of the Xps Essentials Pack ( http://blogs.msdn.com/xps/ ).

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

image

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.

image

Fortunately, it is possible to fix this error.

image

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

<DocumentStructure
xmlns="http://schemas.microsoft.com/xps/2005/06/documentstructure">
<DocumentStructure.Outline>
  <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"/>
  </DocumentOutline>
</DocumentStructure.Outline>
<Story StoryName="MainStory">
  <StoryFragmentReference Page="1"/>
  <StoryFragmentReference Page="2"/>
  <StoryFragmentReference Page="3"/>
</Story>
</DocumentStructure>

which should become:


<DocumentStructure xmlns="http://schemas.microsoft.com/xps/2005/06/documentstructure" xmlns:c="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:b="http://schemas.bvisual.net/xps/" c:Ignorable="b">
<DocumentStructure.Outline>
  <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" />
  </DocumentOutline>
</DocumentStructure.Outline>
<Story StoryName="MainStory">
  <StoryFragmentReference Page="1" />
  <StoryFragmentReference Page="2" />
  <StoryFragmentReference Page="3" />
</Story>
</DocumentStructure>

Note the amended OutlineTarget attributes

… and to the Documents1FixedDoc.fdoc file:

<FixedDocument xmlns="http://schemas.microsoft.com/xps/2005/06">
<PageContent Source="Pages/1.fpage"></PageContent>
<PageContent Source="Pages/2.fpage"></PageContent>
<PageContent Source="Pages/3.fpage"></PageContent>
</FixedDocument>

should become :


<FixedDocument xmlns="http://schemas.microsoft.com/xps/2005/06">
<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>
</FixedDocument>

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:

image

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 – https://www.microsoft.com/en-us/microsoft-365/blog/2009/03/02/canvas-onenote-new-concept-test-officelabs-team/

pptPlex – https://www.microsoft.com/en-us/download/details.aspx?id=28558

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

Related

Filed Under: Save As, Visio

About David Parker

David Parker has 25 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio
  • Grid Snapping Revisited

Categories

Tags

Accessibility Add-Ins Connectors Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript LayerManager Layers Legend Link Data to Shapes Lists MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Setup and Deployment Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Validation VBA Video Visio Visio 2007 Visio for the Web Visio Online Visio Services Visio Viewer Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • Amazon
  • E-mail
  • Facebook
  • LinkedIn
  • Twitter
  • YouTube

Search this website

Recent posts

  • Fixing dimensions of 2D shapes
  • Merging Linked Data from Similar Tables
  • Smart Radio Buttons and Check Boxes in Visio
  • Using Button Face Ids in Visio
  • Grid Snapping Revisited

Copyright © 2025 · Executive Pro on Genesis Framework · WordPress · Log in