1

I'd like to be able to generate arbitrary qr codes and display them on a web page, which will be served by Yesod.

I don't really have any code to share because I don't know how I would go about linking up the QR code generating / diagramming libraries there are and then outputting an image that can be served on the page.

Does anyone have any pointers?

Joe Shanahan
  • 816
  • 5
  • 21

1 Answers1

5

I would recommend this package for generating qr codes. The images can be sendt to the client with this method.

The diagrams-rasterific package can probably be used to create a ByteString which can be sent to the client.

Use the renderDrawing function with the encodePng function from the JuicyPixles package to create the ByteString which you can send to the client using sendResponse

Community
  • 1
  • 1
NatureShade
  • 2,187
  • 1
  • 19
  • 27