@media print {
    /* Hide all elements except the QR code container */
    body * {
        visibility: hidden;
    }

    /* Ensure the QR code container and its content are visible */
    #qrContainer, #qrContainer * {
        visibility: visible;
    }

    /* Align QR code container properly */
    #qrContainer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Arrange the QR codes in a grid */
    .qrcode {
        display: inline-block;
        width: 100px; /* Adjust size for each QR code */
        height: 100px;
        margin: 10px; /* Add some space between QR codes */
        vertical-align: top;
    }

        .qrcode img {
            width: 100%;
            height: auto;
        }

    /* Adjust print margins */
    @page {
        margin: 10mm; /* You can adjust the margins as needed */
    }

    /* Make the body margins and padding zero */
    body {
        margin: 0;
        padding: 0;
    }

    /* Hide unwanted elements such as buttons, logos, or sidebars */
    #printButton, .sidebar, .logo {
        display: none;
    }
}
