I got a question from a customer: We have our processes defined in Visio, we don’t have SharePoint Enterprise CALs to use the Visio webpart. We have links in process maps. What can we do?
Well there are three ways to solve this business need:
- Find money for SharePoint Enterprise – Very expensive
- Show Visio diagrams as pdf files on SharePoint Pages – Expensive.
- Embed Visio diagrams as html image maps – Least expensive
If the business needs other features available only in Enterprise, just use the solution 1. Stop reading.
If you are looking for alternatives, then consider pdf and image maps. I have seen projects where pdf files were embedded in the SharePoint Pages. It required a pdf plugin in IE, a lot of time to make it look the same in different browsers and the scroll and fixed size was still there. It was expensive because of the development and configuration time.
In this blog post, I want to show the alternative number 3: embedding Visio diagrams as html image maps. This is only a Proof-of-concept so far.
Image maps are an old html fellow that can contain links on an image. Links can be connected to areas using coordinates. During a brainstorming session, we thought: what if we define image maps using Gimp or some other graphic tool. This manual procedure is not good when it is time to update the diagrams: it will require a lot of manual work to keep it up to date. So we need to be able to export a Visio diagram to an image map.
Actually Visio lets you export a diagram as an image map. All you need is to save it as as web page. Just to demonstrate I created a simple drawing:
Then I added a hyperlink to a shape:
Then I saved it as a web page:
Getting the actual image map
The web page that Visio creates, is a frameset:
So the actual content (the image map) is inside the _files folder:
You can find the filename of the image map html by reading the main page (Process-Main.html in my case). Usually it is png_1.html (for the first Visio page):
In the page where you want publish the process diagram, add a script editor webpart (or a content editor webpart):
Edit snippet, as usual:
Now you have to copy image tag and the map tag from the html:
Paste it into the Script Editor:
The image tag points to an image that is present in the same folder: png_1.png. We can upload it to a library and update the src attribute. In my case, to test it quickly, and because my image is not big, I’ll create a base64 string of that image using an online tool – dataurlmaker:
Update the src attribute in the Script editor webpart:
That’s it, now we have an image map, a drawing that has clickable elements with links to subprocesses:
This is a proof-of-concept that I will share for publishing Visio drawings as html image maps. It works even in SharePoint Foundation (!). The publishing and republishing involves these three steps:
- Save a Visio file as a webpage (for new and updated files)
- Copy html parts to a SharePoint page
- Update the image reference
The steps are not aimed for end users. But given that you have clear instructions and guidelines how to publish drawings in SharePoint, even editors with basic knowledge about html can do it. This approach lets you keep Visio files as the source and update the process pages in SharePoint quite easy.
If this method works in a real environment, next step would be to create a tool for automatic conversion of Visio files to image maps.