html2svg

I encountered a problem in the project. I converted html to svg, and found a lot of information on the Internet. I recorded it here for the convenience of myself and my friends in the future.

 

 

html code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>test</title>

<link rel="stylesheet" href="bootstrap.min.css">

<script type="text/javascript" src="jquery-1.8.3.min.js"></script>

<script type="text/javascript" src="lodash.min.js"></script>

<script type="text/javascript" src="convert.js"></script>

<script type="text/javascript">

$(function(){

 

$("#testButton").click(function(){

 

 

var svg = html2svg(document.getElementById("ServiceRecommendationsDiv"));

 

$("#testSvg").append(svg);

 

})

 

 

 

 

});

 

</script>

 

 

</head>

<body>

<div id="ServiceRecommendationsDiv" style="border:dotted thin;  height: auto;" align="left">

<h3>Service Recommendations</h3>

 

<div>

<div>

<b>STAR Health Service Coordination</b>

</div>

 

<div>

Youth has met the criteria for Star Health Service Coordination follow-up. (STAR Health Member Services 1-866-912-6283)

</div>

 

<div>

<b>Psychological Testing</b>

</div>

 

<div>

Youth has met the criteria for Psychological Testing.  If the child has not received psychological testing in the past, make a referral for psychological testing.  (STAR Health Member Services 1-866-912-6283)

</div>

 

<div>

<b> Developmental Disability Specialists</b>

</div>

 

<div>

Youth has met the criteria for a referral to the regional Developmental Disability Specialist.

</div>

 

</div>

 

 

 

</div>

<button id="testButton" >appendSVG</button>

<div id="testSvg" ></div>

 

</body>

 

 

</html>

 

Several plug-ins are used in the annotation part of the code, which are attached together

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326375246&siteId=291194637
SVG