Need User Script / Greasemonkey / AJAX - download pdf file, convert to base64 and embed Open

Job ID: 31660285

Budget: $2 – $5 USD

I have a internal webpage with no access from internet, where i created a greasemonkey script to show preview images when i hover over a link to a image file.

I want to do the same with pdf documents, the problem is that it just downloads the document instead of showing the preview. I have two stackoverflow questions which describes the problem a bit:
1. https://stackoverflow.com/questions/69360750/why-does-pdf-document-download-instead-of-showing-in-a-embed-iframe
2. https://stackoverflow.com/questions/69368295/is-it-possible-to-change-http-header-of-a-pdf-document-you-want-to-embed-in-a

Now, i need a ajax script that downloads the pdf and presents the content in a embed html tag.

embed src="data:application/pdf;base64,xxxxxx..." type="application/pdf"

Ask me, and i will provide the code i already have for this
Skills Required
Related categories: PHP JavaScript AJAX HTML jQuery / Prototype