Hello,
Sample.zip (1.3 KB)
I am using the following code to load the EMF file, and to save as SVG, as you can see I am correctly setting the dimensions of the page, but when you open the SVG file in an editor (or even open it in notepad) you can see it is exporting the incorrect dimensions.
Dim license = New Aspose.Imaging.License()
license.SetLicense("Aspose.Imaging.lic")
Dim image = Aspose.Imaging.Image.Load("input.emf")
Dim emfRasterizationOptions As New EmfRasterizationOptions()
emfRasterizationOptions.PageWidth = image.Width
emfRasterizationOptions.PageHeight = image.Height
emfRasterizationOptions.BackgroundColor = Aspose.Imaging.Color.Transparent
emfRasterizationOptions.CenterDrawing = True
Dim opt As New SvgOptions() With {.VectorRasterizationOptions = emfRasterizationOptions, .TextAsShapes = True}
image.Save("asposeoutput.svg", opt)
The exported SVG file has the following:
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="body_1" width="383" height="300">
As you can see it’s setting 383 for width and 300 as height, which I am not sure where it’s grabbing from. If I manually edit the SVG file in a text editor, and change the width and height to the correct dimensions (287 x 220) then the SVG file appears perfectly.
Has anyone else ever encounter this issue?
The original EMF input and Aspose.Imaging exported SVG files have been attached as a zip file.