Is it possible to disable the save option on a PDF popup window?

When displaying a PDF using an embed tag, I have managed to disable print and content copying through document properties. However, I am struggling to find a solution to disable the save option that pops up. Is there a way to achieve this using JavaScript or CSS? Any help would be greatly appreciated. I even tried the code below but it doesn't work after postback.

string embed = "<object data=\"{0}{1}#toolbar=0&navpanes=0\" type=\"application/pdf\" width=\"855px\" style='padding-left:20px;' height=\"700px\">";
embed += "</object>";
ltEmbed.Text = string.Format(embed, ResolveUrl("~/admin/ShowPdf.ashx?Id=1&FilePath="), strFilePath);

Answer №1

Try deleting this section as it may improve the situation.

ResolveUrl("~/admin/ShowPdf.ashx?Id=1&FilePath="), strFilePath

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

PHP ajax handling multiple requests

I've searched high and low on the internet, but couldn't find a solution to my problem. I am making multiple jQuery AJAX calls to a PHP script. Initially, I noticed that each call was being executed only after the previous one had finished. To a ...

What could be causing a full-width image render in Firefox when a nested flex item is centered?

My design involves nested containers with the display: flex; property. While Chrome/Edge display the item div correctly, in Firefox 110.0.1 the item div expands to fill the entire horizontal space within the wrapper (100% width). Which CSS properties can ...

Looking for a reliable contact form?

I am currently in the process of developing an email contact form for a client's website. During my research, I discovered methods to enhance the security of contact forms which piqued my interest. 1. Are there significant risks associated with not ...

Tips on how to send an event as a parameter in C#

Currently, I am in the process of writing unit tests for a multi-threading application that involves waiting for specific events to be triggered before proceeding with assertions. An example scenario is when I make a call to repository.add(something), I ne ...

Positioning an image on the left side of a div within a flex container using

Here is the code I have: .usp-bar { display: flex; flex-wrap: wrap; background-color: #005932; color: #fff; font-weight: 700; padding: 10px 0; margin-top: 0; ju ...

How can I use jquery's data-dismiss to clear a selected file in Bootstrap?

My image uploader div includes a sub-div to display the chosen file and an <a> element that I aim to delete using jQuery. Has anyone successfully achieved this? I tried binding a click event to the <a>, but it didn't work, possibly due to ...

Enhance text content effortlessly with an automated text augmentation feature

Essentially, what I'm wondering is whether there exists a program that can automatically add HTML tags to the text you input. For instance: Let's say I type in: "The world is beautiful" The program would then transform it into: <p align="c ...

Interactive table created with DataTables that automatically updates the dynamic JSON data source whenever changes are made to the table

Using the Datatables plugin, I am dynamically populating a table with HTML rendered from a JSON array. However, I need the table to update the model (datasource) stored client-side whenever an edit is made. When navigating to a new page on the table, it s ...

Challenges arise when attempting to refresh a rate system using location.reload()

Whenever I select a vote, my rating system should update automatically. However, it doesn't work properly without refreshing the page. I tried adding location.reload(); but it only runs after the second click. The issue is that there is a discrepancy ...

Triggering a targeted action upon the user's click on any HTML element

Currently, I am in the process of developing navigation buttons that trigger a dropdown sub-menu when clicked by utilizing checkbox inputs. Upon clicking the label, the input is checked, causing the menu to drop down, and when the label is clicked again, t ...

Is it possible to change text dynamically with an input box using JavaScript?

Is there a way to use JavaScript to create two input boxes for text replacement? Instead of constantly editing code to replace different text, I am looking for a simple user interface with Input Box A, Input Box B, and a button. The first input box will ...

Events in the backbone view fail to trigger after a re-render

For some reason, I am struggling to get mouse events to work on my backbone view after it is re-rendered. It seems like the only solution is to use a rather convoluted jQuery statement: $("a").die().unbind().live("mousedown",this.switchtabs); I initially ...

Tips on setting the ajax parameter contentType to "html"

I'm encountering an issue where the variable "myvariable" is passing as null. Can anyone provide guidance on what I might be doing incorrectly? $.ajax({ type: "POST", url: "/MyController/MyAction", data: JSON.stringify({ items: my ...

Retrieve specialized information from a json file

I have a JSON variable called json which contains some data in JSON format. I am attempting to extract a specific portion of that data. One way to do this is by using the index as demonstrated below: var newdata = json[listid].Taxonomies[0]; However, my ...

Determine the position of an element in relation to a specific ancestor using JavaScript

Let's consider the following example of HTML code: <div id="site_header_container" class="site_bar_container"> <div id="site_header"> <div id="header_logo_container"> <a class="sliced" id="header_ ...

Achieve an overlapping effect with grid items

I'm in the process of creating a CSS grid layout where the header overlaps the next row. Below is a snippet of my code with the header positioned on top, and the linked image should give you an idea of what I'm aiming for. Thank you! https://i ...

Elastic canvas to always match the full size of the container or screen

I am facing an issue with my responsive canvas that should resize to fit the screen window within a div. The canvas is intended to be 1100x1100 but needs to scale based on the screen size while maintaining a square aspect ratio. The problem arises when th ...

JSONP is unable to utilize data fetched from an external API

I attempted to run an ajax request in order to retrieve a collection of items and display them through logging: https://i.stack.imgur.com/IK1qy.jpg However, when checking the console, the items appear as undefined: https://i.stack.imgur.com/3WOCa.jpg O ...

Adjusting the width of a button can result in gaps forming between neighboring buttons

I am currently working on a calculator project that involves customizing the width of a specific button with the ID equal. However, when I adjust the width of this button, it results in unexpected spacing between the third and fourth buttons in each row, c ...

The noclose feature in Twitter Bootstrap is malfunctioning when placed within a div

I have a PHP page named a.php that contains the following code: <ul class="dropdown-menu noclose"> This code functions correctly, preventing the drop-down menu from closing until the user clicks outside the box. However, when I load the entire a.p ...