Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FeatureRequest] Save QRCode to SVG, PDF or EPS as well as PNG #44

Open
namsor opened this issue Nov 6, 2020 · 2 comments
Open

[FeatureRequest] Save QRCode to SVG, PDF or EPS as well as PNG #44

namsor opened this issue Nov 6, 2020 · 2 comments

Comments

@namsor
Copy link

namsor commented Nov 6, 2020

Hi ! Thanks for this library. It would be nice to be able to save the QRCode to SVG, PDF or EPS as well as PNG.

For example, adding dependency to
https://github.com/tdewolff/canvas/
the qrcode.go could have

// Canvas returns the QR Code as an image.Image.
func (q *QRCode) Canvas() *canvas.Canvas {
// Based on Image...
}

and this can be saved to appropriate format using,
c := q.Canvas()
c.WriteFile("out.svg", svg.Writer)
c.WriteFile("out.pdf", pdf.Writer)
c.WriteFile("out.eps", eps.Writer)
c.WriteFile("out.png", rasterizer.PNGWriter(3.2))

Attached a draft modification.

Best,
E.

@namsor
Copy link
Author

namsor commented Nov 7, 2020

NB/ this was prototyped in fork https://github.com/namsor/go-qrcode

@yckbilly1929
Copy link

hi, will this feature be merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants