If the SVG is embedded in a page and scaled, this leads to poorly laid out text and often the underline not matching up to the text.
What would be ideal would be if the following could happen:
Add an option to com.aspose.slides.SVGOptions to control whether the textLength is added to text
Add an option to com.aspose.slides.SVGOptions to control whether an underline is drawn (as per the current behaviour) or if a CSS class is used. If the CSS class is used, then add a class onto the text/tspan element:
<xlink:href=“#category-472”><tspan x=“9.375” y=“21.96484” class=“aspose_underline” font-family=“Verdana” fill=“#FFFFFF”>Case studies</tspan></a>
Add a style element into the SVG with the following:
<style type=“text/css”>.aspose_underline{text-decoration:underline}</style>
The benefits of using classing is that the SVG would become smaller, the underlines would be more accurate and the end user could apply their own style overrides if need be. BTW - this would also be a really useful option in Diagram vsdx->svg.
I have observed the issues mentioned by you and request you to please try using latest Aspose.Slides for Java 20.4 on your end. In case there is still an issue then please share the source file, generted output,. desired output and detail of issue incurring on your end.
test-from-aspose.svg - SVG build with Aspose Java 20.4 and the example save as SVG
test-with-classing.svg - what we’d like to see. No textLength set on the tspans, no <path> elements in the parent <g> for the underlines, but this done with the “aspose_link” class and <style> element inserted at the start of the SVG
If this could be controlled via an SVGOptions setting, that would be great.
I have observed both SVG files. Can you please share what how is second test-with-classing.svg is generated. It will be appropriate, if you may please provide the requirements or issue you are facing in the form of opened SVG data and highlighting the difference between Aspose.Slides generated SVG or any other tool generated SVG. Please also share the source code used too as I will be needing this to log investigation ticket.
Attached is the source pptx, the source code used to generate testshape-from-aspose.svg and an svg for the same file saved with PowerPoint itself.
However, the test-with-classing.svg was an SVG hand created with an idealized use of CSS rather than putting all the font details in the text elements themselves. Using CSS is makes for a lighter SVG, an easier to manipulate SVG and improves rendering.
I have seen the two SVG files (1 generated using Aspose.Slides and other using PowerPoint). Can you please highlight the difference and requirement that out ought to fulfill using Aspose.Slides.
On the tspan elements, aspose uses the textLength attribute. This is not exported by Powepoint and we find it can lead to some odd rendering
The underline for the link is drawn as a path element. We find that the underline and the text don’t always marry up. What would be useful is for the text in the link and the path both to have a CSS class. That way we could hide the path underlines and add text underlines using pure CSS for a more accurate representation.
It would make for smaller resulting SVG files if text elements could have CSS classes rather than using the font attributes. The benefit also being that the classes can potentially be overridden by the end-user’s own CSS.
I have created an issue with ID SLIDESJAVA-38177 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be addressed.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.