Hello, Now i display a pdf file with iframe no problem but i must prevent the users from download it if they click inspect and get the iframe src link, also cam i display the pdf with stream
Everything you send to your user via the browser is for them to download, take screenshots or copy in any other way, nothing is private if you show it to your user.
There are workarounds that might make it "harder" to download the file but if someone really wants the PDF of it they will get it. Like for example this approach: https://betterprogramming.pub/how-to-display-pdfs-but-prevent-them-from-downloading-in-react-2e77292ca9a5 or a "pdf viewer" script might make it harder to download the PDF but I can't give you advice on that as I never used it but searching on "pdf viewer html javascript" should give you some options.
I don't know what you are trying to do but might adding a watermark to your PDF help? If they really want they can of course remove the watermark again but it makes it a bit harder.