Easy Barcode Generation: Create a QR Barcode as a PNG File

1 min readApr 21, 2022


It’s no surprise that QR codes are wildly popular in a world dominated by smartphones. You can easily generate new QR barcodes using our QR code API, with nothing more than text (like a website link) as input. Easily connect using code provided below in Java, or feel free to visit our API Console page and review 12 additional code options.

First, install the Java SDK with Maven. Add a reference to the repository in pom.xml:


Next, add one to the dependency:


Finally, add the import classes and call the QR generating function:

// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.GenerateBarcodeApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
GenerateBarcodeApi apiInstance = new GenerateBarcodeApi();
String value = "value_example"; // String | QR code text to convert into the QR code barcode
try {
byte[] result = apiInstance.generateBarcodeQRCode(value);
} catch (ApiException e) {
System.err.println("Exception when calling GenerateBarcodeApi#generateBarcodeQRCode");




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.