Copy link to clipboard
Copied
After passing the url to the Preview method I found that in the resulting iframe I could not see the URL? I wish to confirm whether this is true. It suits my use-case where even though the PDF is a public resource I would not like it to be available on display. Hence. Thanks
If you pass the PDF as a URL, it will be visible in the page source even though it won't be apparent in the iframe. If you need to obfuscate the location of the PDF. Pass the content as a Promise and leverage some middleware to get the PDF and return just the bytes to your page.
Copy link to clipboard
Copied
If you pass the PDF as a URL, it will be visible in the page source even though it won't be apparent in the iframe. If you need to obfuscate the location of the PDF. Pass the content as a Promise and leverage some middleware to get the PDF and return just the bytes to your page.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Your suggestion worked Joel. I did the following.
1. "Fetched" the PDF. fetch(url-to-pdf)
2. On successful response converted into blob: response.blob()
3. Created localhost URL : URL.createObjectURL(blob)
4. Passed above URL to preview method.
Copy link to clipboard
Copied
Good to hear that you got it working. Be sure to disable both downloading and printing if you want to prevent people from getting to the PDF. Download is obvious but printing back to PDF is another way to get the PDF.
Copy link to clipboard
Copied