Downloading pdf file generated by html & javascript

Hi ! I have a html code with javascript in it. As soon as I load the page it is supposed to generate a pdf file and save it in the system.

This code works perfectly on Visual Studio Code. However when I uploaded this html file alongwith javascript code in App Inventor & generated the apk to test it, the webpage is loaded & visible but no file is being is downloaded. I tried using a ExtendedWebView & CustomWebView extensions but the issue remains unresolved.