I'm designing Windows 8 Reader app, and i have to use a control to display the HTML content in "Webview". I got this right now. My problem is how to increase the font in the HTML content in webview. I don't how to start this.Can any one help me..
I mainly develop for android. But i do have a friend who had the same problem..
What you can do to solve this problem is calling javascript for the webview..
this way you can edit the style of the website from the javascript you call.
But that's the direction i would be looking for now..
Edit..
It should be something like this:
YourWebView.InvokeScript("your script", null);
Related
I have a webview in my UWP windows store app. It recognises html content and renders accordingly. Now I need this webview to be editable. Please help someone.
Have a local html file which has body as contenteditable div and using WebView.NavigateToLocalStreamUri method (Here's the Sample), navigate to this page.Then set the div's content with your string. Also refer WebView.InvokeScriptAsync and ScriptNotify to inject and retreive data from webview.
The WebView is for displaying HTML content only. You'll need to use a different control for editing HTML.
Out of the box there's nothing specific for this. The nearest is the RichTextBox but you'll need to convert what this creates from RTF to HTML. This answer to a similar question points to this guide on how to do it.
you can "inject" javascript to the webview when navigation complete.
the inject script you can do the logic you want in .and you can inject this in the NavigateComplete Event.
WebView1.CoreWebView2.NavigateToString( "<HTML><HEAD/><BODY contentEditable='true'>Hello 2</BODY></HTML>" );
My upcoming mobile web project requires viewing dynamically chosen pdf files inside the webpage. I am using iFrame to display the pdf file and the file can be scrolled using two-finger scrolling. But the problems I am facing are:
The first page of the file is not displayed completely on the iPad and gets cut off along the width unlike when I view it on the desktop browsers where the first page of the pdf is always entirely displayed although zoomed out to fit in the iFrame area.
There is no visual indication for the users that the pdf document can be scrolled, i.e., there is no scroll bar on the pdf document.
The controls (page navigation, zoom etc.) for the pdf viewer (Adobe reader) don't appear on the document unlike when I see it on the desktop browsers.
What is the best way to achieve what I am trying to do? Do any of you experts know any solutions/workarounds to the problems I am facing? An entirely different approach using anything other than iFrame can also be considered.
The reason why the pdf should be inside the html page is that, the list of pdf files will be on a menu bar on the left side of the page and the user can click on any of them to view on the same page. Ideally, they will have the capability to toggle between full screen view and that view.
Any help is appreciated.
I created a tiny JavaScript module that helps you to show a PDF inline and be able to scroll it. But I also couldn't figure out a way to make it fit the total width of the parent container.
Check it out: https://github.com/williamrjribeiro/ipdf-scroll
Cheers.
I came across this Recommended way to embed PDF in HTML? while researching on the web to find an answer.
The mentioned link discusses about some options that I can use and the google document viewer works for me though don't know if there is anything (like data limit) I need to be aware of before using it on the website. Also I have no idea if it is a good solution (though the full screen mode is not available, but zoom-in/zoom-out and next/prev page buttons are there are show up in the mobile safari on the iPad) to use for an web app that will be run on the iPad.
Anyway, I will keep researching for a better solution and if i don't find any, I'll stick to the google document viewer.
The issue appears to be a bug with Safari on the IPad.
I didn't find a solution for embedding the pdf in html but I did find this:
If you return FileStreamResult from your controller action instead of a view, the pdf will open in a new tab, it's not embedded html but at least your user is not having to download files and open them manually.
I had the same problem of the pdf not being displayed completely. The only thing I found to fix this was the change the size of the div containing the pdf.
For example if the element containing the pdf is a div then I change its width to any value and the rollback to the value it had before. Changing Width or height any one works.
Sometimes I had to wait a little using a setTimeout before calling my resizable method
A lot of webpages today, have meta tags or CSS styles, which defines the content width to 320px.
When you load one of these pages in an UIWebView it is not possible to pinch-to-zoom.
(You can try it in the Safari-browser on the iPhone).
As a visual impaired person, I find that very annoying.
Is there anyway to enable pinch-to-zoom for these kind of pages?
Can I in anyway remove those tags/styles?
Can I in some way manually code some mechanism in an UIWebView, which could emulate this functionality?
Any help would be appreciated.
Thank you.
You could load the HTML file that you are going to display in your UIWebView into an NSString, then use a regex to remove the viewport meta tag (which is what I believe disables the zooming), and then load the new NSString into the UIWebView.
Here is the link:
http://www.gbin1.com/gbin1/admin/gbin1app.jsp
i'm using jquery mobile to display the page, but it looks jquery mobile is loading the page very slow. and also it's slow if you click navigation bar. How can i improve the performance? If i remove jquery mobile code, it's kind of faster. what's wrong with the jquery mobile?
Thanks a lot!
Maybe if you load some parts of the html with ajax it will be faster.. I don't know the exact size of the page because it stopped after 400KB
Just installed sIFR into the site I am building (a personal portfolio site). When using it on pages with slimbox popups, sIFR overlaps the slimbox and makes it dificult to see the image. I tried applying a high z-index to the items I didn't want overlapped, but that didn't solve anything. Here is a screenshot of what it looks like (since my site is not online yet):
http://users.sephiroth.ws/DemonicGoblin/sifr.png
Is there a way to hide the sIFR when a slimbox link is clicked, or a way to adjust the z-index for a way to it not to be always on top? This happens on the latest version of all major browsers (I couldn't test Safari or Chrome though, even though I doubt it will differ)
I ahvent been able to find any information regarding this subject, so if it has been fixed in the sIFR beta it would be nice to know. Thanks.
In sIFR 2 you need to set the sWmode parameter to "opaque". This should allow HTML elements to be displayed on top of the Flash movie.
In sIFR 3, the parameter is wmode, though you can also use opaque: true.
Thank you so much - just saved my day.
I saw that lightbox break - so did I nearly:)!!!
But what a straight forward answer and solution thanks!! again
The file in mention is:
sifr.js
and put a code like:
sIFR.replaceElement(named({sSelector:"h1", sFlashSrc: "http://localhost/ddddddd/templates/template/i_font_swf/carbon_std_swf.swf", sCase: "upper", sColor: "#86ca29", sWmode:"opaque", sBgColor:"#fff"}));
I just write it cause took me some time to remember where this setting initially was - when I did the sIFR long ago.