I have this:
<div class="openexcel"> Open excel file </div>
I have added this code too:
$('.openexcel').click(function(){
/* some code here*/
});
Is there any way or any code to add to javascript where I can stop the "save" button once the excel file is opened.
I need the user to read and see but I don't want him to "save" or "save as"
This isn't possible, especially not using javascript.
Once the user opens up the excel document, it is open on their local machine, from their local cache.
You won't have any control over the functions available within their Excel software.
When making data available over the web, you need to accept that there is not a way of preventing people from keeping hold of this data.
Related
I got a webpage where members can download different kind of files on. I wan't to get information about which files and how many times each member have downloaded. when the user want to download a file he get browser pop-up where he gets 3 choises: "Open", "save" and "Cancel".(file dialog box in browser). i want to update the download status only if open/save button is clicked
Is there a way to detect which button was clicked on "save/open/cancel" dialog?
You can't know that. Some browsers even start the download before the user decides what to do with the file. But perhaps you can get your webserver to log if the download has been completed. That's probably the most reliable result you can get.
There is no way to know which button was clicked.
I dont think you can. The site just streams the file to the browser. What the user does
with the file is not known by the website as there is no more server side
interaction.
how to open a save as popup window on click of generatePDF button to save pdf at local drive.i am using jspdf and auto table js to export html table data to pdf.
According to this answer there is no way to force modern browsers to open a save as dialog. Which I am personally happy about as a user. Some people have had luck with using window.open('file.txt');, but that only opens a new tab in chrome.
I would advise you to rethink if you have to give the user a save as dialog or if there is another way to handle it. Maybe it is enough asking them what filename they want to use and then use the default way to save a pdf in jspdf:
var filename = document.getElementById('filename-input').textContent;
jspdfDocument.save(filename);
I would like to print my webpage as an pdf with the window.print(). Right now I just get the dialog box up as default. I was wondering if I could make it select print to pdf and then proceed by it self.
I have tried classes like dompdf etc., but this print to pdf is really what I need here. So if it is possible to set some default printing settings and maybe make it automatically, then let me know.
As mentioned in the comment no you cannot do this. Also not sure if you have custom print button or you are using Ctrl+P shortcut.
In cases you may see a PDF is opened in a new tab and you can download from there.
Otherwise in operations like bank account summary download , generally handled by a kind of form submit , and the pdf is created by controller/service layer by using PDF Generator like iText.
HERE is a link for information on PDF open source library.
What I want to do is: when a user clicks on a button, a folder browser should pop up almost the same way when <input type="file"> is used. The only difference is that I don't want that "Open" button, I want a button with "Save" as text. See that I'm not looking for a file saver in javascript, I just want a dialog that user can navigate inside folders, insert a file name and click on a button called "Save", so that I can make the file saving server-side.
Thanks in advance.
The file browser is part of the operating system, not the web page. Sorry.
I have a website, but I need a button which I want to print a specific .pdf file from my webpage database.
As an example, this site
has a print button, which gives you option to print some pdf files
Any idea how can I do that?
I've tried this one, but it's not working:
<a href="../Documents/ScrittoGraffito/Scritto_Customers/Nicolaides_Optical/Nicolaides_webpage/Shop1_Banner.pdf"
onclick="window.print()"/><p class="test">link</p></a>
That code will tell the browser to open the print dialog for the current page.
If you want to force the browser to print the linked pdf then that is not possible, as it will be completely controlled by the application or plugin that handles pdf documents.
EDIT;
Apparently it is possible, but you have to make use of a pdf toolkit.