The Windward Studio

Windward Blog Home

This is Super Cool – Vectorized Charts, Shapes and SmartArt

Posted on 06/25/2015

Please Share This


At present Windward renders charts, Microsoft Shapes and Microsoft SmartArt to a PNG, and that PNG is then used for PDF, HTML and printer output. This approach could be better because we take objects that are composed of vectors, which are infinitely scalable, and turn them into a fixed rectangle of pixels. And that rendered bitmap looks pretty blurry when you zoom in.

SVG_logo.svgSo we’re working hard to change this, definitely for PDF and HTML and probably for printers, in a future release. Instead of a bitmap, we will convert the vector primitives in all three objects into native vectors for that output. For PDF we will use the PDF primitives for lines, arcs, polygons, etc. For HTML we will generate to a SVG file. This way both outputs will have a native vector-based object. This delivers smaller files and an object that is infinitely zoomable.

Ok, that’s really nice. But the cool part is another advantage this has. With this new approach we are no longer rendering, we’re translating.

If the source object has a red line going from (12.5,3.1) to (14.8, 3.1), we don’t render that line in a bitmap. Instead, we just create the equivalent line draw command in the output file. Writing the code to translate is a lot faster and easier than rendering.

It will take a bit of time to create the framework. But once we do, handling most of the drawing commands will be adding to translation tables that convert from the DOCX vector commands to the output vector commands. And we can then blast through handling most of the commands.

This won’t work for all, because some don’t have a simple 1:1 translation. For a few cases, we’ll have to render that particular command to a bitmap and then embed the bitmap. And for the charting we use a 3rd party charting package and it has a few limits that are very hard to work around (fortunately very few).

But for most of what’s needed, we’ll be delivering a better solution that implements more of the DOCX spec. And that will be really cool.

Want to know what else we’re working on? Check out the Windward features roadmap.

Please Share This

Author: David Thielen

Dave, Windward's founder and CEO, is passionate about building superb software teams from scratch and dramatically improving the productivity of existing software teams. He's really proud that he once created a game so compelling (Enemy Nations) that a now-professional World of Warcraft player lost his job for playing it incessantly on company time. You can read more from Dave on his personal blog, and at Huffington Post.

Other posts by