In XML Compare 13, we launched our exciting new SVG comparison feature. By comparing the XML structure of the SVG, we employ a customisable output pipeline to apply XSLT transformations that analyse identified changes and convert them into a visual representation.
This process effectively highlights the specific portions of the images that have been changed. This was received well and we’ve had some great feedback on the new feature and suggestions for where we might take it in the future. So far so good.
Limitations of SVG markup integration in PDFs
When we came to add the feature to other products in our suite, we ran into a little problem. Both our DITA and DocBook Compare products add result markup that enables you to easily publish changes to a PDF, often called a redline document. Our plan was that the revised SVG change representation would complement this by showing changes to images within the PDF. Unfortunately, our initial testing left us with PDFs containing images that showed no change. This was despite being absolutely certain that the changes were present in the image before publication.
It turns out that the way we added markup in the SVG (using a CSS border style on elements) isn’t fully supported in PDF and the markup was simply ignored. So we’ve gone back to the drawing board – at least in terms of visually representing change.
Revamped SVG comparison in DITA and DocBook
Starting in DITA and DocBook Compare, our SVG compare feature now uses coloured shapes to create bounding boxes around changed SVG objects. We’ve had fun learning some (sometimes complicated) maths to calculate the size and orientation of the boxes and we’re happy with the end result. Redline PDF output now includes markup to highlight SVG image changes. And there’s also an added benefit – all of the boxes we add have ids with a consistent prefix, making it easy to modify or remove them as you see fit.
We will continue to improve the SVG comparison capabilities and if you have any requests for improvements, we’re always keen to hear them. Head over to the support portal and let us know what you think.
SVG comparison is available in our latest releases of DITA Compare – 11.2 – and DocBook Compare – 9.2. Keep an eye out for release announcements with improvements in the future!