Remove [work] Download Button: Pdf Js
Either delete the line or add the hidden attribute to the tag. Option 3: Disabling via URL Parameters
To remove the download button in , you can use three primary methods: hiding it with CSS, modifying the viewer.html source code, or programmatically filtering it out if using a wrapper library. Because PDF.js is a client-side library, any file sent to the browser is technically "downloaded" to the user's cache, but removing the UI button is an effective way to discourage casual saves. Option 1: Hiding with CSS (Quickest Fix) pdf js remove download button
If you are hosting your own version of the PDF.js library, you can permanently remove the button from the markup. Navigate to the web/ directory in your PDF.js folder. Open . Search for the button with the ID download . Either delete the line or add the hidden
#download { display: none !important; } #secondaryDownload { display: none !important; } Use code with caution. Option 1: Hiding with CSS (Quickest Fix) If
This is the most common method as it doesn't require modifying the core logic of the viewer. You can add a simple CSS rule to your stylesheet or directly into the tag of the viewer.html file.
This hides the entire toolbar, not just the download button. Implementation Comparison Matrix