Hello,
I’m using Aspose.Imaging for .NET (with a Developer OEM license) to convert EMF files to SVG.
Here is a file where the bottom right corner text is lost after the conversion.
Could you please take a look at this ?
Thanks !
MissingTextOnBottomRightCorner.zip (228,8 Ko)
@VincentRTE
It seems that you are experiencing an issue with missing text in the bottom right corner when converting EMF files to SVG using Aspose.Imaging for .NET. This can sometimes occur due to how text is rendered during the conversion process.
To address this issue, you can try the following approach:
-
Use Text as Shapes: Ensure that you are setting the TextAsShapes
property to true
in your SVG options. This will convert text to shapes during the conversion, which can help preserve the appearance of the text.
-
Set Background Color: Specify a background color for the rasterization options. This can sometimes affect how text is rendered, especially if the text color is similar to the background.
-
Adjust Page Size and Margins: Make sure that the page size and margins are set appropriately. If the text is too close to the edge, it might get clipped during the conversion.
Here is a sample code snippet that demonstrates how to set these options:
string dir = "c:\\temp\\";
using (Aspose.Imaging.FileFormats.Emf.EmfImage emfImage = (Aspose.Imaging.FileFormats.Emf.EmfImage)Aspose.Imaging.Image.Load(dir + "yourfile.emf"))
{
Aspose.Imaging.ImageOptions.SvgOptions saveOptions = new Aspose.Imaging.ImageOptions.SvgOptions();
saveOptions.TextAsShapes = true; // Convert text to shapes
Aspose.Imaging.ImageOptions.EmfRasterizationOptions rasterizationOptions = new Aspose.Imaging.ImageOptions.EmfRasterizationOptions();
rasterizationOptions.BackgroundColor = Aspose.Imaging.Color.White; // Set background color
rasterizationOptions.PageWidth = emfImage.Width; // Set page width
rasterizationOptions.PageHeight = emfImage.Height; // Set page height
rasterizationOptions.BorderX = 50; // Set horizontal margin
rasterizationOptions.BorderY = 50; // Set vertical margin
saveOptions.VectorRasterizationOptions = rasterizationOptions;
emfImage.Save(dir + "output.svg", saveOptions);
}
Make sure to replace "yourfile.emf"
with the actual filename of your EMF file. This code sets the necessary options to help ensure that text is rendered correctly in the output SVG.
If the issue persists, consider checking the EMF file for any specific characteristics that might affect text rendering, or consult the Aspose documentation for further details on rasterization options.
Feel free to reach out if you have any more questions or need further assistance!
I tried but it didn’t work.
Hello @VincentRTE ,
We will review your request and give a feedback shortly!
@VincentRTE
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): IMAGINGNET-7619
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.