Skip to content

Commit 9d47364

Browse files
committed
Add the feature of generating SVG images
+ Add the feature of generating SVG images
1 parent 71bd973 commit 9d47364

File tree

15 files changed

+2657
-88
lines changed

15 files changed

+2657
-88
lines changed

canvas2svg.js

Lines changed: 1297 additions & 0 deletions
Large diffs are not rendered by default.

demo/demo_node.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ var config4={
153153

154154
// === Logo
155155
// logo: "https://avatars1.githubusercontent.com/u/4082017?s=160&v=4", // LOGO
156-
logo: "avatars.png", // LOGO
156+
logo: "./avatars.png", // LOGO
157157
// logo:"http://127.0.0.1:8020/easy-qrcodejs/demo/logo.png",
158158
// logoWidth:80,
159159
// logoHeight:80,
@@ -222,8 +222,12 @@ qrcode8.saveImage({
222222
path: 'q4.jpg'
223223
});
224224

225-
qrcode5.toDataURL().then(data=>{
226-
console.info('======QRCode JPG DataURL======')
225+
qrcode5.toSVGText().then(data=>{
226+
console.info('======QRCode SVG Data Text======')
227227
console.info(data)
228228
console.info('')
229-
});
229+
});
230+
231+
qrcode8.saveSVG({
232+
path: 'qrcode.svg'
233+
})

demo/q2.jpg

12 Bytes
Loading

demo/q2.png

-1.06 KB
Loading

demo/q3.jpg

264 Bytes
Loading

demo/q3.png

-1.11 KB
Loading

demo/q4.jpg

188 Bytes
Loading

demo/q4.png

-387 Bytes
Loading

demo/qrcode.svg

Lines changed: 1 addition & 0 deletions
Loading

demo/svg.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title>SVG demo</title>
6+
</head>
7+
<body>
8+
<embed src="./qrcode.svg" />
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)