I think the title explains it all.
If I try to use .raw to server an SVG barcode without using .save first, I get an empty output...
Example:
Trying to serve this in my django project:
class APIBarcode(View):
def get(self, request, *args, **kwargs):
uuid = request.GET.get('uuid')
C39 = barcode.get_barcode_class('code39')
toserve = C39(uuid)
toserve.save('c39code')
return HttpResponse(toserve.raw, content_type="image/svg+xml")
Gives the following output:
But serving this:
class APIBarcode(View):
def get(self, request, *args, **kwargs):
uuid = request.GET.get('uuid')
C39 = barcode.get_barcode_class('code39')
toserve = C39(uuid)
# toserve.save('c39code')
return HttpResponse(toserve.raw, content_type="image/svg+xml")
Gives the following output:
If someone can point me to where I should be looking I would gladly attempt to fix it!