Bug 46757

Summary: WMF Transcoding problems with positioning of elements
Product: Batik - Now in Jira Reporter: Andrew Barnham <andrew.barnham>
Component: UtilitiesAssignee: Batik Developer's Mailing list <batik-dev>
Status: NEW ---    
Severity: major    
Priority: P2    
Version: 1.8   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Problematic .wmf resultant .svg with and without patches.

Description Andrew Barnham 2009-02-22 20:36:54 UTC
Created attachment 23298 [details]
Problematic .wmf resultant .svg with and without patches.

Hi Had a few problems with some wmf's I am trying to convert into svg.

See attached .zip file. It contains 3 items:

Original WMF
Resultant SVG that Batik 1.8pre emits (with clipping removed, I hacked dom to remove it because causes me troubles)
Resultant SVG after I patched in some hacks into code.

I hacked in some fixes so not a critical issue for me, but would be nice for a fix to appear so that I don't have to maintain a patched version for my own needs.

Hack #1 - org.apache.batik.transcoder.wmf.tosvg.WMFRecordStore
---
253c
                    } else {
                        ySign = 1;
                    }
.
249c
                    } else {
                        xSign= 1;
                    }
.
---
This one definitly looks like a bug to me. If I have a view port/window thingo that sets up a port with -ve numbers then a second one with +ve numbers then xSign/ySign do not get reset. Looks like to me that they should.

Hack #2 - VpX/VpY settings. Image was not aligned/offset correctly.
---
183,184c
                    currentStore.setVpX( vpX = (float)mr.elementAt( 0 ) );
                    currentStore.setVpY( vpY = (float)mr.elementAt( 1 ) );
.
---

Original code havd -ves in there. Dunno why but when I removed them my .wmf to .svg came good (almost) - it is not aligned quite the way I'd like it but it's close enough for my purposes.