Web browser connection in codename one - codenameone

when url like youtube.com or others are set, it opens in webBrowser but when pdf link is kept nothing happens, why is that??
WebBrowser pdfview = new WebBrowser();
pdfview.setURL("http://www.codenameone.com/files/developer-guide.pdf");
//this link downloads the pdf file in browser but does nothing in codename one browser...
f.addComponent(pdfview);
i jst want to view this pdf from the browser

Opening a PDF in the browser component will only work on devices and won't work in the simulator.

Related

How do i open a local pdf file in the browser with the download option

I want to open a PDF file in the browser but instead of opening, it is downloading. I do not want to change the default settings of the browser.
If there any PDF viewer package which is easy to use, please refer.
I tried like this
first import the pdf
import Pdf from "../../../assets/pdf/abc.pdf";
then tried to open it like this
<a href={Pdf} target="\_blank" className="btn"\>Learn More</a>
But it is downloading the file. But I want to open it.
If you are using Chrome browser, select the three vertical dots in the upper-right corner.
Choose Settings > Advanced > Privacy and security. Select Site Settings > PDF documents.
Use the toggle switch next to Download PDF files instead of automatically opening them in Chrome to turn the feature on and off.
As a user you have full control, as a server you can only request the user follows your desires, but they do not have to.
A PDF application/pdf mime file is a potential source of exploit so just like a user can change settings to block adverts or images they can also block unsolicited display of a PDF.
The browsing client may choose to download and view or download only or do not download it is the same in Mozilla or Chromium, just different plugins.

Mac office.js Word add-in open pdf using window.open

Env: Mac, Office 2016 build 15.26
On a button click, I fetch pdf base64 bytes from the server and call window.open to launch another browser instance to open pdf.
window.open("data:application/pdf;base64,"+ pdfbytes)
On Windows add-in, it works fine.
On Mac, the dialog box appears asking "choose application to launch'data:application/pdf"
All the applications are grayed out, so I could not select Safari or Chrome to launch pdf.
When I open add-in URL from Chrome browser on Mac, and click the same button, it launched new Chrome tab instance and opens the pdf fine.
Any better way to show pdf through word add-in?
this is a bug in the product, its now fixed and will ship as part of the December Office update for Mac. thanks for reporting this and making our platform better!

windows phone webbrowser control file download

I have a file hosted in a secured site (https), so I use the web browser control to pass the URL and the headers for authentication. Can the WebBrowser control render the document/pdf files just like the phone native browser. Even the public document(not secure) are not rendering. Does the webbrowser control similar to the native phone IE when it comes to file download?
If you just want to open a PDF from a web location you'll have to do:
new WebBrowserTask
{
Uri = new Uri("http://path.to/file.pdf", UriKind.Absolute)
}.Show();
This depends on the user having the Adobe, PDF viewer app installed on their phone. There's no way to show a PDF document within the WebBrowser control.

IE6 closes new browser window when I set iframe's source to a file download service

In our application, we have a download flow that works as follows:
On main application page has a link showing file name to download. Target of this link is _blank.
User clicks this link. We open a new window.
The new window shows a wait message, makes an ajax call first to verify the file details from server (we have server implementations for this).
There is a hidden iframe in new window. After verification of file details, I set the file download url as the source of iframe so download request is sent via iframe.
When file response is received, IE6 suddenly shows a yellow bar at the top and then closes this new window forcefully. I do not see any file save dialog.
This works fine in IE7 and IE8, although I see the yellow security bar here too but window does not close, so I can start a manual download.
Can anyone help me on this? Is this a bug in IE6 that was resolved in IE 7/8?
Best regards,
Nadeem
I got it. Actually this is a bug of IE6 and you could get more info about it here: http://support.microsoft.com/kb/896017.
Regards,
Nadeem Ullah

IE7 not showing SVG contents instead of that its opening the content as an Office document

Hi I am facing an issue with IE7 browser if i launch any URL with .svg or any page with svg content its asking for file download and trying to open with MS Office.
is ther a fix for this?
There is an IE Add-on for this: Adobe SVG Viewer
http://www.adobe.com/svg/viewer/install/
IE7 doesn't support SVG. If you have control of the server, you can try a workaround like ExplorerCanvas. If you have control of the client, you can use pretty much any other browser (Firefox, Safari, Chrome, Opera, ...), or wait for IE9.

Resources