I'm trying to view/download a PDF/Docx file on click of anchor tag.
The link is like below
<span style="font-size: 8.5pt; font-family: Verdana, sans-serif, serif, EmojiFont; color: rgb(25, 118, 210); background: white;">SampleDOC</span>
The above link works fine with iPAD/iPhone/MAC/Windows but not in Android Outlook wed add-in.
In Android Outlook web add-in the txt file download works fine via link.
Is there any other way to implement links other than using anchor tags ?
As per this link, window.open is not supported in Outlook web add-in.
Any help is appreciated.
#microsoft team: I've uploaded below GIF which shows what happens when a link is clicked.
Please let me know if you are in need of more information
If you are using this snippet <span style="font-size: 8.5pt; font-family: Verdana, sans-serif, serif, EmojiFont; color: rgb(25, 118, 210); background: white;">SampleDOC</span>, on-click you must be redirected to browser and browser will give the option to download the file. Unlike iOS, Android itself does not support rendering .doc or .ppt files.
You must be seeing the same behavior if you check the email with the same link.
Related
I'm wondering if it's possible to download the PDF directly from another website's URL rather than opening a new window.
<button>Download FILE</button>
The most recommended way would be something like this
<!DOCTYPE html>
<html>
<body>
<h3>https://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml5_a_download</h3>
<p>Click on the image to download PDF32000_2008.pdf<p>
<a href="https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf" download><img src="https://www.w3schools.com/images/myw3schoolsimage.jpg" alt="PDF32000_2008 standard" width="104" height="142">
</a>
<p><b>Note:</b> The download attribute is not supported in IE or Edge (prior version 18), or in Safari (prior version 10.1).</p>
</body>
</html>
That is preferable to your method in that it lets the user decide the time of the download and rename document! Also you only need to serve a cover icon or image. HOWEVER although this works without any problems for me as a client user "offweb" it may not work same as any other link on a server if it is cross site tainted. The href address should only be for resources served on or via your own site.
and that should also be the case even if you use iFrame or any other hyper download method, without addressing Cross Origin issues.
Hence something like your current method is often touted as a "workaround" to bypass any Cross Site limitation, since the call for a fresh tab is a direct link from client browser to remote source thus not via "person in the middle" again HOWEVER, you should improve security by adding to it:-
<button>Download FILE</button>
<!DOCTYPE html>
<html>
<body>
<h3>https://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml5_a_download</h3>
<p>Click on the image to download PDF32000_2008.pdf<p>
<a href="https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/PDF32000_2008.pdf" rel="noopener noreferrer" target="_blank"><img src="https://www.w3schools.com/images/myw3schoolsimage.jpg" alt="PDF32000_2008 standard" width="104" height="142">
</a>
<p><b>Note:</b> The download attribute is not supported in IE or Edge (prior version 18), or in Safari (prior version 10.1).</p>
</body>
</html>
Note the snippet above was update to latest Adobe location and works as a file but here on Stack Overflow your browser may block the call !
The linked page gains partial access to the linking page via the window.opener object:- see https://stackoverflow.com/a/45902400/10802527 and https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
I am trying to use Font Awesome on my website. I am testing that site on a local Apache2 webserver. When I view that site as served by my local Apache webserver, the Font Awesome icons display as little boxes.
However, if I view that same file just by the relevant web page from my file system (I'm using Ubuntu 16.10), they display fine.
Further, I have another web server running NginX, and if I upload my HTML and CSS files there, and view the page, the Font Awesome icons display fine.
In other words, it appears that only Apache can not load the Font Awesome files. If I look at the network response in Firefox's developer options, I see this error:
404 Not Found
The requested URL /icons/fontawesome-webfont.ttf was not found on this server.
Why is Apache2 not finding the Font Awesome files when NginX and my local file system have no problems?
For reference, this is the relevant CSS:
#font-face {
font-family: 'FontAwesome';
src: url('../icons/fontawesome-webfont.eot?v=4.2.0');
src: url('../icons/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), url('../icons/fontawesome-webfont.woff?v=4.2.0') format('woff'), url('../icons/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), url('../icons/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
I know this topic is widely discussed but I can not find even partial answer that works for me.
So I'm working on a ASP.NET MVC 4 application. For testing purposes I want to use images from my local machine. In my view I have:
<div class ="banner-top" style="width: 200px; height: 200px;">
<img src='file:///C|:/Users/My-Pc/Desktop/Images/banner-big-top.png' alt="banner"/>
</div>
This is only one of the many attempts I made while trying to display this image. I can see a plain text banner and that's all. I tried forward slash, black slash, and I don't remember what else but neither was working and my setup is absolutely simple - the solution is on my local machine, the file is on the local machine. So how can I display this image? Could it be that MVC 4 itself is preventing the image from showing? I tried everything in FF and Chrome, all the different ways didn't work on both browsers.
Assuming your images are in your project, you would do:
<img src="#Url.Content("~/content/images/banner-big-top")" alt="banner" />
Based on the path you listed in the question, it looks like the images are not inside of the website. Why not move them into the website and access them via the website root path?
If moving the files into the website isn't an option, then look at this:
How to display images on a page when images are stored outside of web root
I am trying to use web fonts in my Windows phone application. From the comments I have read, I understood that it is not possible to use fonts embedded into XAP file. So, I am trying to open a webpage that contains Google Web Fonts which is at: http://omercelik.com/e.htm
When I open this page from Internet Explorer on phone, it shows the font correctly. But when I try to load this page from a webBrowser control, it doesn't loads this page. I don't do anything else but this on my app:
private void PhoneApplicationPage_Loaded_1(object sender, RoutedEventArgs e)
{
webBrowser.Navigate(new Uri("http://omercelik.com/e.htm"));
}
So, still no success to show custom fonts in my application. There are suggestions to host font remotely and cache but even without caching, I couldn't show fonts. Can someone provide a working example of this?
It is possible to embed truetype fonts in Windows Phone 8 webapps by setting the embeddable tag on the font to 0 using software like TTFEdit. This might prove a more reliable and elegant solution to your problem.
See my answer to another Stack Overflow question here for all the details.
When using the WebBrowser control, it's very important to include the HTML doctype if you want to get proper IE10 behaviour (ie. not quirks mode) in Windows Phone 8...
<!DOCTYPE html>
<html>
<head>
<style>
#import url(http://fonts.googleapis.com/css?family=Tangerine);
</style>
</head>
<body>
<div id="para" style="font-family:'Tangerine', serif;">Making the Web Beautiful</div>
</body>
</html>
For future reference, Windows Phone 7's WebBrowser control (based on IE9) does not support Web Fonts.
I am using Google Doc Viewer to display local PDFs on our site (override for IE7 and 8 because of permissions issue): http://www.scad.edu/news/index.cfm?pageid=338423. The issue is that sometimes people have experienced the PDF not being displayed, being replaced with an iframed Google sign in page. I am having a lot of difficulty reproducing these results, trying several browsers, even clearing my entire browser cache, using off-site browsers such as Adobe BrowserLabs and BrowserShots, etc. I know the error is occurring on an OS X 10.5 machine running Firefox 3.5.2 and on another machine with similar software. The not-so-technical personnel are claiming it happens after not having signed into Google for a week or so, but it displays fine for me when I am signed out on a fresh install. And yes, I have witnessed the issue several times on their machines but simply can not reproduce it.
Please advise on how to hunt down this bug. I can't find anyone else with the same issue. I am considering just switching to Scribd PDF viewer.
The not-so-technical personal may actually be on to something. This issue seems to occur when a Google user's session expires. The user is presented with the login form instead of the document, even when the viewer is embedded in an iframe. Apparently it's still an unresolved bug. Check out this question for more details:
Embedded Google Docs PDF viewer displays login page rather than PDF
I hope they fix this :)
this is related with permissions check your permissions and try again,i think viewer can reach your files if you give permission.
Just do this prior to loading the gdocs viewer, it should solve the problem every time.
<iframe id="google-signout"
src="https://www.google.com/accounts/Logout"
style="width: 943px; height: 1px; display: none;"
frameborder="0"></iframe>