@media print {
    /* Hide all elements by default */
    body * {
        visibility: hidden;
    }

    /*
     * Show only the printable area and its children.
     * The printable area is marked with the 'printable-area' class.
     */
    .printable-area, .printable-area * {
        visibility: visible;
    }

    /*
     * Position the printable area at the top of the page.
     */
    .printable-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Remove any background colors and shadows for print */
    .printable-area, .printable-area * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}
