QR Code in B2B signed Invoices

My B2B invoice has been cleared by zatca sandbox. After decoding (Base 64) the signed invoice, I have seen that ZATCA has generated the QR code. Is there anything else I need to do to the QR Code to meet TLV format? I need to print this QR in crystal report. What should I do? Save it to the database and try to print it to the crystal report or I first decode it before saving to database and try to print it in the crystal report?

@anjuga and @eCloud. Please provide step by step instruction on how to print QR code once a B2B invoice has been cleared by Zatca.

Read the QR Code from XML.
No need to convert or do anything with QR Base64 Text.
Save it in Database Table (if you want )
While Generating PDF, Create QR Code using Saved Base64 String

Extract Base64QRCode Content from clearedInvoice document xml and create Qrcode image/picture with that content.

I have a ARRSRVRBSUwgTkFTRUVNICBTVE9SRQIPMzEwMjgxNjY1OTAwMDAzAxMyMDI1LTAxLTI3VDA5OjIxOjU5BAUzOS4wMAUENS4wOQYsWnBTTnRJUEZhSUhGZml0cTc1eGFDYUtLdFNxbWxRYnpqQTkwL2MrZG84QT0HYE1FWUNJUUNtcjV3WkJuNFpyV3lqZG8vS2p6UndSQ0dYVU9tR3U5R1ZLUUptVm8zTFd3SWhBTzl1QmtSRGFDYTFFM1FGQmpXdkhmWEdlSUdzMFFUTk5FNWxYK2RjZ2lLeQhYMFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAESaNjlrE42BtqbyvCZGLKF3iG+xCYxbgKuAG6qEpPqqvbIcLV/LmaDEzymSm5uWl6bpDsT/zUcOWGOhIUwAGwNQ==

from cleared invoice, Now how to show it as qrcode??? do i have to convert it in any format??

You can convert it to an image and read it from your reporting tool/template

This code will save the QR Code Image to a specified path if provided otherwise on Application Running Path. Once QR is Saved, you can load the image in Crysal Report at run time.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
using ZXing; // Make sure to install ZXing.Net via NuGet

public class QRCodeGenerator
{
    /// <summary>
    /// Generates a QR Code from the provided content and saves it as an image file.
    /// Developed by Muhammad Ather Shahzad.
    /// </summary>
    /// <param name="content">The content to encode into the QR code.</param>
    /// <param name="width">The width of the generated QR code (default: 500).</param>
    /// <param name="height">The height of the generated QR code (default: 500).</param>
    /// <param name="savePath">The file path where the QR code image will be saved. If null, the image will be saved in the application's default path.</param>
    public static void GenerateQRCode(string content, int width = 500, int height = 500, string savePath = null)
    {
        // Create a barcode writer for QR Code generation
        var writer = new BarcodeWriterPixelData
        {
            Format = BarcodeFormat.QR_CODE,
            Options = new QrCodeEncodingOptions
            {
                Width = width,
                Height = height,
                Margin = 0
            }
        };

        // Write QR code data
        var pixelData = writer.Write(content);

        // Create a Bitmap image to hold the QR code
        using (var bitmap = new Bitmap(pixelData.Width, pixelData.Height, PixelFormat.Format32bppRgb))
        {
            // Copy pixel data into the Bitmap
            using (var ms = new MemoryStream())
            {
                var bitmapData = bitmap.LockBits(new Rectangle(0, 0, pixelData.Width, pixelData.Height), 
                                                 ImageLockMode.WriteOnly, 
                                                 PixelFormat.Format32bppRgb);
                try
                {
                    // Copy the QR code pixel data into the Bitmap
                    System.Runtime.InteropServices.Marshal.Copy(pixelData.Pixels, 0, bitmapData.Scan0, pixelData.Pixels.Length);
                }
                finally
                {
                    // Unlock the Bitmap data
                    bitmap.UnlockBits(bitmapData);
                }

                // If a save path is specified, save the image to that location
                if (!string.IsNullOrEmpty(savePath))
                {
                    string directory = Path.GetDirectoryName(savePath);
                    if (!Directory.Exists(directory))
                    {
                        // Create directory if it doesn't exist
                        Directory.CreateDirectory(directory);
                    }
                    // Save the QR code as a JPEG image
                    bitmap.Save(savePath, ImageFormat.Jpeg);
                }
                else
                {
                    // If no save path is provided, save it in the application's default path
                    string defaultPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "QRCode.jpg");
                    bitmap.Save(defaultPath, ImageFormat.Jpeg);
                }
            }
        }
    }
}

Which Language are you using C#, PHP etc?