It is perfectly working for desktop browsers and I am able to download PDFs with my letter pad background. But while working on mobile, the background just disappears, other alignments are proper. Can anyone please help me to solve this?
Following is the code I am using:-
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="print.css" media="print">
<style>
body {
-webkit-print-color-adjust: exact !important;
color-adjust: exact !important;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
background-color: #f5f3f4;
background-image: url('img/letter_pad.jpg');
background-repeat: no-repeat;
font-size: 2vw;
}
.initial-padding {
margin-top: 25vw;
}
h5, p {
font-size: 2vw;
}
table {
border: 1px solid black;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid black;
}
</style>
</head>
<body id="content">
<div style="visibility: hidden;position: absolute;z-index: -10;">
<img src="img/letter_pad.jpg" style="visibility: hidden;width: 100%;z-index: -10;">
</div>
<div class="container initial-padding">
<div style="float: right;">
<h5 class="d-inline">Date:- </h5>
<p class="d-inline"><u>06/06/2021</u></p>
</div><br><br>
<!-- <h1 class="text-center">Title</h1> -->
Respected sir,<br><br>
Basic letter formating
</div>
<button onclick="window.print()" id="print-btn" class="d-flex mx-auto mt-2 mb-5">Download</button>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
</body>
</html>