Hello, I have a though problem. I want to generate...
# cfml-beginners
n
Hello, I have a though problem. I want to generate a QR Code in a CFDocument PDF. But it seems that I cant use any JavaScript in it. Is it possible to use Javascript in a CFDocument PDF? If you want i can show you the code too if its necessary :)
a
You won't be able to use Javascript in a PDF file to generate the QR Code. You can create the QR code as an image and embed the image in the document though.
I've used the https://github.com/zxing/zxing java library to do this
n
can I use this for the swiss QR code too?
a
Oh so that's a much more specific requirement. Looks like this Java library will do it but I've not used it https://github.com/manuelbl/SwissQRBill
p
If you can generate the file and save it to a base64 image string then pass it into a
imagewriteBase64()
it in your pdf that should do the trick.
f
If you use cfhtmltopdf tag it does support some javascript, but using the java library might be a more resilient solution long term - good idea to use base64 encoded image as well.