- Home /
Printable a Certificate for completing a task
I want to let the users of my game be able to print out a certificate that they completed a task. How can I make a link to download a png or pdf in my Unity game. Any ideas would be greatly appreciated.
Answer by Chik3r · Jul 21, 2018 at 12:16 AM
To save a Texture2D from Unity to a PC (as PNG), you need to
1) Convert it to a byte[]: texture.EncodeToPNG();
2) Save the byte Array File.WriteAllBytes(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/face.png", textureByteArray);
More info: https://answers.unity.com/questions/245600/saving-a-png-image-to-hdd-in-standalone-build.html
Also, if you want to print the image in a printer, I found this: https://stackoverflow.com/questions/28938880/using-a-printer-to-print-unity3d-game-statistics
Your answer
Follow this Question
Related Questions
how to download pdf/image file in unity web player? 1 Answer
Have a download link in my app 0 Answers
Download Links from GUI 2 Answers