Save PDF form Chrome IFRAME - google-chrome

I am POSTING a form to an IFRAME (target) which returns a PDF (content-disposition=inline;filename="x.pdf").
This works with current Chrome and Firefox and the embedded PDF viewer.
The only problem is, that Chrome is not able to save the PDF (it tries to save x.html with no content) (with Ctrl+S and with the icon in the PDF toolbar).
Any ideas?

Actually, it is a limitation from native Chrome PDF Viewer. You cannot save PDF file when it is displayed from an iframe using Chrome PDF Viewer (plugin).
Using Adobe Reader plugin for Chrome works perfectly.
Cheers

Related

Embedded PDF Issue in Edge Browser

When using the Microsoft Edge browser, by default when you open a PDF it will open the PDF in a new tab using the built-in PDF viewer. To avoid this, you can adjust the browser's settings: Toggle on the "Always open PDF files externally" option. This works great. However, it presents a separate issue. Our internal applications use embedded PDFs in iframes. When the external toggle is set to on, these PDFs will not show in the iframes. This doesn't happen in Chrome. Has anyone else experienced this and know a work around?
I've tried removing the type="application/pdf" from the iframe tag to no avail. I can't find anything else online.
It looks like an expected result because you have enabled the option Always open PDF files externally.
So MS Edge browser is giving you an option to download the PDF file and open it using the desired app.
You said this doesn't happen in Chrome browser.
If you enabled the Download PDF files instead of automatically opening them in Chrome option then you will notice the same result in the Chrome browser.
Output in the Chrome browser:
If you click on the Open button then it will download the PDF file.
I did not get any solution or a workaround for this issue.
If you think that there should be an option to load the file in an iframe if Always open PDF files externally option is enabled then I suggest you click on the Send Feedback button in the MS Edge browser and try to provide your feedback about it to the Microsoft.
I posted feedback suggesting that an exclusion/inclusion list be in included but the simplest way would be to treat the frame as part of the session. But this is not Microsoft it is the Chrome projects issue.

How to load a PDF file embeded in an iFrame on electron browser

We have an app which launches Electron browser. In the Electron browser we load a third party website which has a link.
When we view this site in the Chrome or IE browsers, clicking on this link it renders a PDF in an iFrame but for electron browser it shows a save file dialogue. We want to display this PDF in the electron browser just the same way it works for Chrome and IE. As it is a third party website we don't have control over rendering or loading PDF file or we are not getting any events related with loading of this PDF.
For this scenario, if there is no way to display PDF in electron then it is OK to block it so the Save file dialogue will not show.(This app is actually in the KIOSK so we don't want to save a file if it doesn't render in browser.)
Thanks in advance for your comments!
Here is a discussion on an issue almost identical to yours. The answer does a decent job explaining why the download option is appearing. As for preventing the pdf from being downloaded, try using the <embed> tag as it detects compatibility. So embed the pdf using that tag and then load the html into the <iframe>. Here is some example code and description of how to set that up.

validate pdf in Selenium using chrome browser

When I click on a link in a page, a PDF opens. I need to validate the contents of this PDF file using Selenium in C#.
I'm able to handle this in Firefox 25(using pdf.js). In firefox, the contents of this pdf are displayed in html and hence, using isTextPresent, I am able to validate if the pdf contents are correct.
But, though Chrome opens the pdf in my browser, it does not show the pdf contents as separate elements. Is there any plugin/ setting change that can be done for me to view the pdf as html in Chrome browsewr
PDF.js is also available for Chrome - see PDF Viewer in the Chrome Web Store.
I suggest to load the PDF using the following URL: chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/content/web/viewer.html?file=<URL-encoded version of PDF file's location>.
The reason for explicitly putting the URL as shown before is that if the PDF url is visited before the extension is loaded, then the default PDF behavior is triggered (in Chromium, the file is downloaded, in Chrome, it's displayed using Chrome's built-in PDF Viewer).
After the PDF.js is loaded, you can directly type the URL for a PDF file in the omnibox, the extension automatically detects PDF files and renders the result (based on MIME-type).

Use Adobe reader instead of chrome pdf viewer to display a pdf

I'm outputting a pdf which has been made with scribus, and in all browsers except for chrome it outputs fine, however with chrome the letters are cut off and lower than usual. I found that disabling the chrome pdf viewer fixes the issue locally. But what about users who do not have it disabled? Is there some way I can make adobe reader show it instead of the chrome pdf viewer in my code?
Any help is appreciated,
Thanks
Edit: I can't make the user download the pdf as it is somewhat a preview before they send it in.
One option would be to use a Content-Disposition header to force the PDF to download as an attachment. When the user clicked on the downloaded file, it would then open in their registered PDF viewer rather than in Chrome.
I ended up flattening the pdf using the flatten option, it unified the result accross all browsers.

Acrobat JavaScript this.submit(url, false) does not work on Chrome PDF Viewer

I have a PDF document, using a button on the form I submit to a URL using
this.submitForm(url, false);
works fine with Adobe Reader Plugin but not with Chrome PDF Viewer, does Chrome PDF Viewer submit forms using a different method?
Chrome has its own PDF viewer called Chrome PDF Viewer, and AcroJS won't work (mostly) on Chrome PDF Viewer. One needs to detect the plug-in, and force the user to use Acrobat Reader if the browser is Chrome's own.
Submitting forms is an not yet implemented feature of Chrome PDF Viewer. See http://code.google.com/p/chromium/issues/detail?id=65446 for Details and (missing) progress and star it to push dev's interest.