I am using the QR Coder library in C# to generate QR codes that will go to a URL with a Token in the Query String. https://github.com/codebude/QRCoder
Currently, I can Print Preview all the QR Codes, but without a Token showing beneath it.
I need to display a string below the QR Code image with a Token Code when I click on the Print Preview button. This will fetch all the QR Code images and show them on the Print Preview window.
The Print Preview button will fetch all the Tokens generated, append them to a link and finally generate the base64 string for the QR Image that is sent to a JavaScript Print method.
I am using Print JS: https://printjs.crabbly.com/
Below is my JavaScript method below with the following code (Multiple Image Mode):
function printAllQRCodesForProduct(base64, printwidth) {
printJS({ printable: **base64**, type: 'image', imageStyle: 'width:' + printwidth + '%;margin-
bottom:10px; float:left; margin-right:10px;' });
}
It does not seem that Print JS can allow you to have multiple image captions. If this was the case, that would work. Perhaps I can modify the Print JS code or perhaps is it possible to somehow take the generated Base64 image QR code and append a string with the Token text just below it without having to render the image on a Canvas tag and then re-saving it as a Base64 string? Can all this be done on the Code-Behind in C#?
So in summary, is it possible to modify a base64 generated image with another image and combine them, or is there a way to add text and get a new base64 image string?
I see that it is possible to add text to a generated Bitmap in C#.
Found the answer on this post: c# write text on bitmap