{"id":2734,"date":"2022-08-09T21:37:14","date_gmt":"2022-08-09T16:37:14","guid":{"rendered":"https:\/\/www.edopedia.com\/blog\/?p=2734"},"modified":"2022-08-09T21:37:17","modified_gmt":"2022-08-09T16:37:17","slug":"export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module","status":"publish","type":"post","link":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/","title":{"rendered":"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is svgexport?<\/h2>\n\n\n\n<p>svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installation<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm i -g svgexport<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Usage<\/h2>\n\n\n\n<p><strong>Scale 1.5x proportionally:<\/strong><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">svgexport input.svg output.png 1.5x<\/pre><\/div>\n\n\n\n<p>Scale proportionally to set output width to 32px:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">svgexport input.svg output.png 32:<\/pre><\/div>\n\n\n\n<p>Scale proportionally and pad output to set output width:height to 32px:54px:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">svgexport input.svg output.png pad 32:54<\/pre><\/div>\n\n\n\n<p>Export\u00a0<code>-1:-1:24:24<\/code>\u00a0(<code>left:top:width:height<\/code>) of input.svg to output.png:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">svgexport input.svg output.png -1:-1:24:24 1x<\/pre><\/div>\n\n\n\n<p>Set output JPEG quality:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">svgexport input.svg output.jpg 80%<\/pre><\/div>\n\n\n\n<p>Use a CSS to style input SVG:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">svgexport input.svg output.jpg &quot;svg{background:silver;}&quot;<\/pre><\/div>\n\n\n\n<p>By default, Puppeteer has a page load timeout of 30 seconds. This might not be enough for large SVG files. If you want to change the page timeout, set the\u00a0<code>SVGEXPORT_TIMEOUT<\/code>\u00a0environment variable to the desired number of seconds.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">\/\/ One minute timeout\nSVGEXPORT_TIMEOUT=60 svgexport input.svg output.png<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Node.js Module<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Installation<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm install svgexport --save<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Usage<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">&lt;span class=&quot;pl-k&quot;&gt;var&lt;\/span&gt; &lt;span class=&quot;pl-s1&quot;&gt;svgexport&lt;\/span&gt; &lt;span class=&quot;pl-c1&quot;&gt;=&lt;\/span&gt; &lt;span class=&quot;pl-en&quot;&gt;require&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;(&lt;\/span&gt;&lt;span class=&quot;pl-s&quot;&gt;'svgexport'&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;)&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;;&lt;\/span&gt;\n\n&lt;span class=&quot;pl-s1&quot;&gt;svgexport&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;.&lt;\/span&gt;&lt;span class=&quot;pl-en&quot;&gt;render&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;(&lt;\/span&gt;&lt;span class=&quot;pl-s1&quot;&gt;datafile&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;,&lt;\/span&gt; &lt;span class=&quot;pl-s1&quot;&gt;callback&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;)&lt;\/span&gt;&lt;span class=&quot;pl-kos&quot;&gt;;&lt;\/span&gt;<\/pre><\/div>\n\n\n\n<p><code>datafile<\/code>\u00a0can be an object, an array of objects or a JSON file path, see command line usage for its format<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Node.js Express App in Browser<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm init -y<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm i express<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm i multer<\/pre><\/div>\n\n\n\n<p>Make a\u00a0<code>uploads<\/code>\u00a0directory inside the root project<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">index.js<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const express = require('express')\n\nconst multer = require('multer')\n\nconst {exec} = require(&quot;child_process&quot;)\n\nconst bodyparser = require('body-parser')\n\nconst path = require('path')\n\nvar storage = multer.diskStorage({\n    destination: function (req, file, cb) {\n        cb(null, 'uploads')\n    },\n    filename: function (req, file, cb) {\n        cb(null, Date.now() + path.extname(file.originalname)) \/\/Appending extension\n    }\n})\n\nvar upload = multer({ storage: storage }).single('file')\n\nconst app = express()\n\napp.use(bodyparser.urlencoded({extended:false}))\napp.use(bodyparser.json())\n\napp.get('\/', (req, res) =&gt; {\n    res.sendFile(__dirname + &quot;\/index.html&quot;)\n})\n\napp.post('\/svgtoimage', (req, res) =&gt; {\n    const format = req.body.format\n    console.log(format)\n    const outputfile = Date.now() + `output.jpg`\n    upload(req,res,(err) =&gt; {\n        if(err){\n            console.log(&quot;Error in Uploading file&quot;)\n        }\n        else{\n            console.log(req.file.path)\n            exec(`svgexport ${req.file.path} ${outputfile}`,(err,stderr,stdout) =&gt; {\n                if(err){\n                    console.log(&quot;error in conversion of svg&quot;)\n                }\n                else{\n                    res.download(outputfile,(err) =&gt; {\n\n                    })\n                }\n            })\n        }\n    })\n})\n\napp.listen(5000, () =&gt; {\n    console.log(&quot;App is listening on port 5000 &quot;)\n})<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">index.html<\/h2>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;en&quot;&gt;\n&lt;head&gt;\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\n    &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt;\n    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &lt;title&gt;SVG to PNG\/JPEG&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;form action=&quot;\/svgtoimage&quot; method=&quot;post&quot; enctype=&quot;multipart\/form-data&quot;&gt;\n        &lt;input type=&quot;file&quot; accept=&quot;.svg&quot; name=&quot;file&quot; required id=&quot;&quot;&gt;\n        &lt;select name=&quot;format&quot; id=&quot;&quot;&gt;\n            &lt;option value=&quot;png&quot; selected&gt;PNG&lt;\/option&gt;\n            &lt;option value=&quot;jpg&quot;&gt;JPG&lt;\/option&gt;\n        &lt;\/select&gt;\n        &lt;button&gt;Export to Image&lt;\/button&gt;\n    &lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is svgexport? svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files. Installation Usage Scale 1.5x proportionally: Scale proportionally to set output width to 32px: Scale proportionally and pad output to set output width:height to 32px:54px: Export\u00a0-1:-1:24:24\u00a0(left:top:width:height) of input.svg to output.png: &#8230; <a title=\"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module\" class=\"read-more\" href=\"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/\" aria-label=\"Read more about Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":1762,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-2734","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module<\/title>\n<meta name=\"description\" content=\"What is svgexport? svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module\" \/>\n<meta property=\"og:description\" content=\"What is svgexport? svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/\" \/>\n<meta property=\"og:site_name\" content=\"Edopedia\" \/>\n<meta property=\"article:author\" content=\"trulyfurqan\" \/>\n<meta property=\"article:published_time\" content=\"2022-08-09T16:37:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-08-09T16:37:17+00:00\" \/>\n<meta name=\"author\" content=\"Furqan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Furqan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module","description":"What is svgexport? svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/","og_locale":"en_US","og_type":"article","og_title":"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module","og_description":"What is svgexport? svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.","og_url":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/","og_site_name":"Edopedia","article_author":"trulyfurqan","article_published_time":"2022-08-09T16:37:14+00:00","article_modified_time":"2022-08-09T16:37:17+00:00","author":"Furqan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Furqan","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#article","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/"},"author":{"name":"Furqan","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339"},"headline":"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module","datePublished":"2022-08-09T16:37:14+00:00","dateModified":"2022-08-09T16:37:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/"},"wordCount":164,"commentCount":0,"publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/","url":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/","name":"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#primaryimage"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","datePublished":"2022-08-09T16:37:14+00:00","dateModified":"2022-08-09T16:37:17+00:00","description":"What is svgexport? svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.","breadcrumb":{"@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#primaryimage","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/02\/default_featured_image.jpg","width":880,"height":495,"caption":"Default Featured Image"},{"@type":"BreadcrumbList","@id":"https:\/\/www.edopedia.com\/blog\/export-svg-to-png-jpeg-image-using-nodejs-expressjs-svgexport-module\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.edopedia.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Export SVG to PNG\/JPEG Image Using Node.js Express.js and SVGExport Module"}]},{"@type":"WebSite","@id":"https:\/\/www.edopedia.com\/blog\/#website","url":"https:\/\/www.edopedia.com\/blog\/","name":"Edopedia","description":"Coding\/Programming Blog","publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.edopedia.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.edopedia.com\/blog\/#organization","name":"Edopedia","url":"https:\/\/www.edopedia.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","width":400,"height":100,"caption":"Edopedia"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339","name":"Furqan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","caption":"Furqan"},"description":"Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.","sameAs":["http:\/\/www.edopedia.com\/blog\/","trulyfurqan"],"url":"https:\/\/www.edopedia.com\/blog\/author\/furqan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/2734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/comments?post=2734"}],"version-history":[{"count":0,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/2734\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media\/1762"}],"wp:attachment":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media?parent=2734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/categories?post=2734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/tags?post=2734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}