QRService
Name | QRService |
Class Path |
|
Versions | 9 10 11 |
Overview
The QRService provides utility methods to generate QR codes from text input. It supports:
Generating QR codes as files.
Returning QR codes as file streams.
Encoding QR codes in Base64 format.
Available Functions
generateQrFileStream(String input, int size): FileInputStream
Generates a QR code as a PNG file and returns it as a file stream.
Parameters:
input(String): The text content to encode in the QR code.size(int): The size (in pixels) of the QR code.
Returns:
FileInputStream: A stream to the generated QR file.
Throws:
IOException: If the file cannot be created or read.
generateQrFile(String input, int size): File
Generates a QR code as a PNG file and returns it.
Parameters:
input(String): The text content to encode in the QR code.size(int): The size (in pixels) of the QR code.
Returns:
File: The generated QR code image file.
Throws:
IOException: If the file cannot be created.
generateQrBase64(String input, int size): String
Generates a QR code as a PNG image and encodes it in Base64 format.
Parameters:
input(String): The text content to encode in the QR code.size(int): The size (in pixels) of the QR code.
Returns:
String: A Base64-encoded PNG image of the QR code.
Summary
The QRService provides simple QR code generation with multiple output formats:
File (
Fileobject)File Stream (
FileInputStream)Base64-encoded string
This service is useful for applications requiring QR-based authentication, data sharing, or URL encoding.