<p>I spent a lot of time with this issue and finally reached a solution for embeeding PDFs in a HTML files, also inspired by this post. You mentioned that &quot;converting the PDF to images and then sliding them in a div&quot; was not satisfactory due to quality problems. Here I experienced the same since the images were blurry.</p>
<p>However, I tried converting the images to SVG instead of PNG and the situation was a different one: The fonts were crystal-clear when embedding the image like below:</p>
<pre><code>&lt;object type=&quot;image/svg+xml&quot; data=&quot;https://ik.imagekit.io/nudvztcu8my/pdf2svg_example_Ft2FQgqWaG.svg&quot;&gt;
    &lt;!-- Your fall back here --&gt;
    &lt;img src=&quot;https://ik.imagekit.io/nudvztcu8my/pdf2svg_example_Ft2FQgqWaG.svg&quot; /&gt;
&lt;/object&gt;
</code></pre>
<p>You can directly paste that snippet into a HTML file and you will see the result. For producing this example I used a ramdom <a href="https://arxiv.org/abs/2201.01851" rel="nofollow noreferrer">PDF from ArXiv.org</a> and <a href="https://converter.app/pdf-to-svg/" rel="nofollow noreferrer">converted it to SVG</a> using an online converter.</p>
<p>There are also free command line tools like <a href="https://stackoverflow.com/questions/4120567/convert-pdf-to-svg">pdf2svg</a> or commerical APIs like Aspose and probably it is worth examining which approach gives the best results.</p>
<p>You can easily build a slider which is loading the SVG images dynamically and it is even possible to scale them to different viewports due to the vector character of the SVG images. The approach so far worked for all PDFs I tried but probably it is recommendable to implement a fallback solution still using PNGs.</p>
How to embed a PDF in an HTML page?
<p>I need to embed a PDF file in an HTML page for the users to see it on every major device.
<strong>Most of the approaches work fine on desktop but they start to show problems on iPad devices.</strong> The PDFs are no longer scrollable if placed inside an iframe or embed tag.</p>

<p>I used the following techniques to overcome the problem:</p>

<p>1) Using <a href="https://www.npmjs.com/package/pdf-image" rel="nofollow noreferrer">pdf-image</a> for node and converting the PDF to images and then sliding them in a div.
The problem in this approach is that the image quality gets degraded and is not suitable for viewing on Web.</p>

<p>2) Using <a href="https://mozilla.github.io/pdf.js/" rel="nofollow noreferrer">PDF.js</a> by Mozilla
It works fine on every device but it <strong>makes the page extremely slow and unresponsive</strong> on iPad</p>

<p>3) Using Google PDF viewer</p>

<pre><code>&lt;iframe src="https://docs.google.com/viewer?url=http://public-Url-of-pdf.pdf&amp;embedded=true" frameborder="0" height="500px" width="100%"&gt;&lt;/iframe&gt;
</code></pre>

<p>The <strong>problem with this approach is that I need to make my PDFs publicly available</strong> which I don't want to do for security reasons.</p>

<p>None of the above method is working for me. Is there any solution available to embed PDF in a page which works on iPad also.</p>

<p>One of my colleagues told me about using <strong>LibreOffice(open office) headless</strong> to embed PDFs in my page but I cannot find any documentation about it usage?</p>

<p>Can anyone please help? :( </p>

<p>Thanks in advance!</p>