How to open a file directly from msSaveOrOpenBlob? - javascript

I am using IE 11 for web development. Now in javascript, I do window.msSaveOrOpenBlob(fileBlob), a pop up shows on the button of the page with save and open option.
Now what I want to achieve is that perform click event on open so the file will be open automatically(without user click open).
Here is the case:
User click a link, it should open the associated file with whatever file reader that can open the file. PDF, will be adobe reader, word document will be opened in microsoft word.
Things still works when I click the open button from pop up. I just want to skip this manual click and do it in the code.
I've seen some webpage does this, but can't figure out myself. Need some help.

As far as I know, we can't control the "open or save" prompt using JavaScript. It is the browser behavior.
As a workaround, to the pdf file, I suggest you could try to use the pdf.js plugin to display the pdf file. To the Office documents, you could check the following article to use the Office Web Viewer to view the document.
Office Web Viewer: View Office documents in a browser
Besides, here is an article about displaying (Show) Word, Excel, PowerPoint (PPT) and PDF files in browser web page in ASP.Net, you can also refer to it.

Related

Add custom button to Adobe Acrobat Pro toolbar (permanently) to "Open current document's folder" in Windows File Explorer

I want to add a button (permanently) to customize the Adobe Acrobat Pro toolbar that launches Windows File Explorer in the directory of the currently open document. I constantly navigate (several times per day for years) to Acrobat's "File... Properties..." menu to open the Properties dialog box, and then click on "Location" field (a clickable hyperlink) with the mouse to open Windows File Explorer. This is too repetitive and tiring.
I need a button that is available whenever I open any file in Adobe Acrobat. I need this to be a permanent addition to the regular toolbars; I don't want to have to manually add this action to every document. It looks like it will require Javascript.
I need a Javascript function to "Open current file location" and instructions on how to permanently attach this Javascript to a new (named) button on Adobe Acrobat Pro toolbar(s). I am new to JavaScript inside Acrobat, and unfamiliar any potential security issues.
I have created a new "Create New Action..." called Open_WindowsFolder_for_Current_Document using the Acrobat Pro Action Wizard. The next step is to select actions from the lists of pre-programmed actions. There is nothing in the Wizard to "Get File Properties object, extract the location string, and then feed this current file location string into another wizard step to launch Windows File Explorer.
WHAT I HAVE TRIED:
I checked the Adobe Acrobat Community Forums but found no libraries of Javascripts to drop into these types of wizard actions.
I found documentation on Github for "ExtendScript" but the learning curve looks very STEEP, like many hours or days to set up this simple action that I could do with the Word or Excel Macro Recorder in minutes. ExtendScript
Can someone help me by providing a script and guidance for how to set this up?
Thanks in advance!

How to download PDF in chrome viewer using automation script

I have to download PDFs using any automation script, when i click on download PDF button, it opens up in new tab in chrome pdf viewer, manually I can click on Download button and download. But when I try to automate it, I can see the button id 'Download' in Inspect element, but when I use command Document.GetelementbyID('Download').click(), the button or any other icon on screen in not getting identified.
I tried changing the chrome setting to directly download pdf, instead of opening in new tab, but it fails for large PDFs (maybe something wrong with source application). I cannot change browsers.
So is there a way to download pdf from pdf viewer, some key shortcut or some script to retrieve the PDF from chrome temp.

How to open powerpoint file in a browser using javascript

I'm trying to embed a powerpoint presentation in my offline site but fail to find a suitable open source library that can view my pptx file. I want to use a viewer that can view the pptx content and retain the transition etc. of the pptx file. Then detect if the user reach the end of the slide. Thank you for your help guys.

How To Highlight The Text In PDF Files Through Chrome Extension

I am new to programming. I am creating a Chrome extension, which is when clicked shows a pop-up with many categories with check boxes. If you click the checkbox, the extension will interact with web page and highlight text related to selected categories.
Now my question is how to highlight the text in pdf files when I am clicking the popup page checkbox. Or how to interact with the pdf files from Chrome extension. Please help me.
I don't believe you can. The built in PDF renderer in Chrome is just a plugin. You can see that by viewing the source of the page.

Trigger click on embedded PDF

I have a PDF embedded in a web page using the following code:
<object id="pdfviewer" data='test_full.pdf#page=1&toolbar=0&statusbar=0&messages=0&navpanes=0'
type='application/pdf'
width='500px'
height='350px'>
The PDF itself is set to open in full screen mode which shows no controls. The user can advance the slides by clicking on the view.
What I'd like to have is some way to trigger that click so that I can advance 2 similar PDF:s side-by-side (one for the actual slideshow and one for the speaker notes). Is this possible to do in javascript and/or jQuery? I have tried using the click()-method but it doesn't get through to the embedded PDF.
Update: Can't find any info on it, so I guess I'm out of luck and have to try a workaround. Am currently juggling 3 embeds of the same pdf (current page, next page and previous page), hiding and showing them and loading more pages as the user clicks around.
I doubt it. Allowing web page scripts to pass input events to the PDF viewer could be a security risk (since the viewer generally has access to system file dialogues via things like Save As).

Categories