Skip to content

Using chrome headless to convert svg to png by golang

License

Notifications You must be signed in to change notification settings

canhlinh/svg2png

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svg2png

Using chrome headless to convert svg to png

GoDoc

Example:

package main

import (
	"os/exec"

	"github.com/canhlinh/svg2png"
	"github.com/sirupsen/logrus"
)

func main() {
	chrome := svg2png.NewChrome().SetHeight(600).SetWith(600)
	filepath := "Soccerball_mask_transparent_background.png"
	if err := chrome.Screenshoot("https://upload.wikimedia.org/wikipedia/commons/8/84/Example.svg", filepath); err != nil {
		logrus.Panic(err)
	}

	exec.Command("open", filepath).Run()
}

About

Using chrome headless to convert svg to png by golang

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages