|125757||Sep 9,2016 06:57 AM||Sep 12,2016 05:04 AM||ASP.NET MVC||1|
On a website, I have a collection of items, each containing some information for a QR code, and a need for saving the QR code for each item to a separate file for download and insertion into a document in a text editor e.g. Word.
The information for the QR code is:
If possible, I would like to create and save all QR codes in a loop somewhat like this:
Foreach (item in items)
Generate QR code
Save QR code to file
I would prefer the QR code saved to an image format rather than a pdf if possible.
If all the generated files automatic could be zipped into one file afterwards for easy download for the user would be awesome.
I can render the QR code to a webpage, but not save it to a file. I’m 99% sure I’ve seen an example of it done online, but now I can’t find I again.
Can this be done, and if so please provide an example.
Syncfusion.Compression.Zip.ZipArchive zip = new Syncfusion.Compression.Zip.ZipArchive();
//Create a new PDF QR barcode
PdfQRBarcode barcode = new PdfQRBarcode();
//Set the barcode text
barcode.Text = "the text to encode";
//Export the barcode as image
Image img = barcode.ToImage();
MemoryStream ms = new MemoryStream();
//Save the image to stream
//Archive the image to zip
zip.AddItem("img"+i.ToString ()+".png", ms, false, FileAttributes.Normal);
MemoryStream outputStream = new MemoryStream();
//Save the zip file.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.