I have a html string like "From: User Demo ABC TEST ". I need to display this string in a uwp xaml control which will render this in html format.
Sample Attached. Im new to Windows App development.
Suggest me some control with sample code which will fulfill my requirement.
PS: This content is dynamic and might contain any basic html tags.
At first, you can use WebView element with NavigateToStringmethod.
Look this sample for Windows 8.1 App which you can use in UWP.
At second, install Windows App Studio WinRT XAML & UWP Libraries and use HtmlBlock control which convert HTML string into native UWP controls
Related
I have only written PC programs using C#, .NET, and WinForms, and am new to app development.
I have written a program that uses HTML files (as a type of "form"), that will then be passed to an app, which can then be used to read/record data. I.e.
On the PC, a user creates a HTML "form"
This is loaded onto a mobile device (phone or tablet)
The user can then open the app, and access each individual (or individual copies) a HTML form to read/record data.
This is then transferred back to the PC, and stored.
Now, I'm not too concerned with the transfer between the PC/device, or the storage of the data, or any of that at this point. What I am concerned about is the ability to open/view these HTML files within a single app.
As the program has already been written using .NET and WinForms, it needs to be converted to be used on a mobile device, and I have chosen Xamarin for this purpose. However I only have limited knowledge of this package, so I am not sure if I can achieve this within a single app (i.e. without having to pass it to a separate app to view the HTML files).
So: is there an environment in Xamarin that I can use to view HTML files within my app?
Xamarin.Forms has a WebView class that you can use to display HTML content, so viewing the content is rarely an issue.
Interacting with the HTML content can sometimes be a bit tricky because of the links not conforming to what the app expects. But you can often solve these issues using the WebView.Navigating event handler that will allow you to catch and change the navigation behavior.
Xamarin.Forms's WebView relies on the native UIWebView (iOS) and WebView (Android) and Xamarin.Forms allows you to override the native Renderers. Overriding the native renderer will give you access to the native WebView with full flexibility.
You also have the possibility to completely ignore Xamarin.Forms's WebView and write your own view using native views.
It would probably be smart to test your WinForms app on iOS using Safari and on Android using Chrome as they are using the same rendering engines that will be used in respectively UIWebView (iOS) and WebView (Android)
I want to generate a PDF File of my Invoice.Xaml Page layout in windows universal platform in windows -10 for mobile view.
I don't have any idea about it and I am on initial stage so i can't afford any paid api/DLL so please suggest me a better solution which has no cost.
You can use the default print dialog and choose "Print to PDF" as your printer. Check out the MSDN docs about how to print from your app and the GitHub sample
The new Microsoft Edge browser has built-in support for Adobe Flash. The updated WebView control in the Windows 10 SDK utilizes Microsoft Edge as its engine.
I am trying to figure out how to enable the WebView control to render Adobe Flash content from a website in a Universal Windows App (either a Hosted Web App or a Packaged Web App).
Any ideas or pointers would be much appreciated.
Thanks.
WebView doesn't use Edge as the engine but uses IE11. Quote from the docs - "WebView always uses Internet Explorer 11 in document mode".
It also doesn't support any plugins or such, which would include Flash.
Full run of caveats from the control doc:
It does not support any ActiveX controls or plugins like Microsoft
Silverlight or Portable Document Format (PDF) files. Additionally,
WebView does not support some HTML5 features including AppCache,
IndexedDB, programmatic access to the Clipboard, and geolocation.
More "tidbit" reading up at https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.webview.aspx .
Enjoy. Hope this helps. Healy in Tampa.
On Universal application, the webview is using edge now but it does not change anything regarding plugins.
Here is what it says from the MSDN :
In apps compiled for Windows 10, WebView uses the Microsoft Edge
rendering engine to display HTML content. In apps compiled for Windows
8 or Windows 8.1, WebView uses Internet Explorer 11 in document mode.
It does not support any ActiveX controls or plugins like Microsoft
Silverlight or Portable Document Format (PDF) files.
I have started creating windows phone 8 app and captured an image (.jpg) file, now I want to convert this .jpg file in to .pdf file.
Is there any way to do this ?
Please help me.
Thanks,
As you know that windows app support winrt .winmd files only and normal dll doesnt work in window apps. So you would need the pdf sdk for rendering a pdf and add image to it. In Aspnet application Itextsharp dll is free sdk to support it but there are lot of paid sdk available Component One.But there are free sdks like SilverPdf, itextsharp custom. or try to create new one Or you can extend to Web api service by using service (post api) with image encoded in byte array and in serverside using free tools like the itextsharp you can generate it as pdf and return it to windows app.
I do have a Kendo UI Mobile app which I created with the VS Icenium extension. My question is if it is possible to open remote pdf documents with the native pdf viewer which is installed on a mobile device.
Currently, I'm using this code in order to open a document:
if (device.platform === "Android")
window.open(data.uri, '_blank');
}
else
window.open(data.uri, '_system');
}
This opens the browser and downloads the file, which is retrieved from a wep.api .NET MVC webservice. On iOS it works quite well. But on Android it opens the browser and starts the file download in the background and the document is not opened in the browser. It is necessary to pull down the message center in order to open the file.
But like I said, it would be great if I could check if a pdf viewer is installed on iOS / Android and ask the user to open the document with it otherwise opening the file in the browser using the code from above.
Searching the internet the only option I was able to find was pdf.js (which I wasn't able to implement into my app).
I'm an absolute beginner with HTML5, jquery, Kendo UI Mobile etc. and it would be great if you guys could give me your help!
Thank you in advance!
Regards,
Martin