Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SvgExporter: exportString: small offset in the y-axis on text (Read 1429 times)
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
SvgExporter: exportString: small offset in the y-axis on text
Aug 23rd, 2022 at 9:55am
Print Post  
Hi,

When we export our diagram to a SVG string with SvgExport.exportString(diagram), and convert it to a Blob URL in order to download it as an SVG, we notice that the text within the diagram SVG has a small offset in the y-axis.

An image of the exported diagram is added in the attachment.

Below is our code to export the diagram and convert it to a downloadable svg image:

-----------------
var exporter = new MindFusion.Diagramming.SvgExporter();
var svgElement = exporter.exportString(diagram);
const blob = new Blob([svgElement], { type: "image/svg+xml" });
const url = URL.createObjectURL(blob);
downloadURI(url, "exportedDiagram.svg");
-----------------
function downloadURI(uri, name)
{
    var link = document.createElement("a");
    link.download = name;
    link.href = uri;
    document.body.appendChild(link);
    link.click();
    document.body.removeChild(link);
    delete link;
}
-------------------


Kind regards!
  

diagram_exportedURI.png ( 3 KB | 64 Downloads )
diagram_exportedURI.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: SvgExporter: exportString: small offset in the y-axis on text
Reply #1 - Aug 23rd, 2022 at 12:14pm
Print Post  
Hi,

New build here should fix that -
https://mindfusion.eu/_beta/jsdiag423.zip

Kind regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
Re: SvgExporter: exportString: small offset in the y-axis on text
Reply #2 - Aug 24th, 2022 at 11:44am
Print Post  
Hi Slavcho,

Yes, now everything is positioned perfect! Thank you!!

Kind regards
  
Back to top
 
IP Logged
 
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
Re: SvgExporter: exportString: small offset in the y-axis on text
Reply #3 - Aug 24th, 2022 at 12:11pm
Print Post  
Hi Slavcho,

Is it possible that in the new Beta version of your last reply, the Styled text character 'newline' ( = '<br />') is not supported anymore?

In the attachment are an older version of MF and the Beta version result shown.
The Shapenodes with a newline in it show in the new Beta version no text .

Note: The older MindFusion version could also allow '</br>' as a new line.

Kind regards.


  

betaversion.png ( 7 KB | 69 Downloads )
betaversion.png
olderVersion.png ( 11 KB | 68 Downloads )
olderVersion.png
documentation.png ( 18 KB | 67 Downloads )
documentation.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: SvgExporter: exportString: small offset in the y-axis on text
Reply #4 - Aug 25th, 2022 at 8:53am
Print Post  
Hi,

Our bad, new build should fix it -
https://mindfusion.eu/_beta/jsdiag423.zip

Kind regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Mindfusion User
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 11
Joined: Apr 26th, 2022
Re: SvgExporter: exportString: small offset in the y-axis on text
Reply #5 - Sep 1st, 2022 at 6:27am
Print Post  
Hi,

Great! Thank you!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint