Is there any PDF Viewer in .NET MAUI App? - c#

I am using .NET MAUI app for migrating my xamarin.forms into .NET MAUI. I have problem which i have to view pdf file in .NET MAUI app or in .NET MAUI Page as i previously did in Xamarin.Forms. I was using SfPdfViewer in Xamarin.Forms and it was working fine.
Kindly Help or guide please.
I want to View Pdf file in .Net Maui page in mobile app.

No, but hear me out. Search for PDF rendering instead.
Those viewers are doing a lot of useless work. In most cases you will want to simply scroll over the content of your PDF.
The way I achieve this is by rendering the PDF to images. And then using container to display them. You can set the DPI when rendering, so you don't make them too big (if you are using phone for example). You can implement some background loading, etc.
The end result is that you have something running at light speed.

As per their site, it looks like they don't have PDFViewer in MAUI. However, you should be able to integrate Blazor PDF Viewer into the MAUI app. Check out this documentation. I hope this helps.
https://blazor.syncfusion.com/documentation/getting-started/maui-blazor-app

#Muhammed Ali,
Greetings from Syncfusion!!
We have added PDF Viewer control in .NET MAUI to view PDF files in our latest Essential Studio 2022 Volume 4 Main Release V20.4.0.38. In this first release, we have provided support for displaying PDF files with page navigation and magnification functionalities. We will be adding more features to the control in our upcoming releases on a priority basis.
Please check our user guide and try this new PDF Viewer control in your application.
https://help.syncfusion.com/maui/pdf-viewer/overview

Related

Printing a html in a Maui Blazor app running on Android not working

I have a Maui-Blazor app and I want to print a html (modal). The app should allow the user to print to PDF or any other format. The app runs inside Android.
I am using the following package for printing: https://github.com/Append-IT/Blazor.Printing.
However, when I run the app on Android, the print functionality does not work. I am not sure what the problem is and I would like help resolving this issue.
In Windows, printing works perfectly, but on Android, Do nothing
I have been searching for a solution to print a PDF or HTML in a Maui Blazor app running on Android. I came across a link (https://learn.microsoft.com/en-us/answers/questions/914868/how-to-print-pdf-html-in-maui) that suggests using the WebView class, but it does not provide a clear example of how to implement this in .NET and Blazor-Maui.
How can I use the WebView class to print a PDF or HTML in a Maui Blazor app running on Android? Can anyone provide a clear example or guide on how to implement this in .NET and Blazor-Maui?
or there is better opition ?

WebView.NavigateToLocalStreamUri() method example for WPF WebView

I could not find an example of WebView.NavigateToLocalStreamUri(Uri, IUriToStreamResolver) Method for WPF WebView.
All the examples, such as this and this, I've seen so far are for UWP Webview
Question: Can someone please either give or point to an example for WPF Webview where it shows how to load local web content (e.g. local html file) at the specified Uniform Resource Identifier (URI) using an IUriToStreamResolver?
Remark: I'm using latest versions of VS2019, .NET Core on Windows 10 Pro

Enable Flash plugin in WPF using CEFSharp

I'm developing a WPF application using Cefsharp. This web browser inside the app should show some flash contents. I found some forum where the users suggest to use papi flash or pepper flash for Cefsharp.
I have no idea how to implement those plugin in my project.
I'm using the last version of Cefsharp.
Someone can explain how to enable Flash contents in my webview?
Thanks
You need to download the PPAPI version of Flash. Every computer running your app must do the same. Visit http://get.adobe.com/flashplayer/otherversions/ and select FP [xx] for Chromium and Opera where [xx] is the current version number, which is 26 at the time of this answer.

Capturing the image of a web page using Firefox and Safari

I have a utility that I put together that uses the .NET Framework to capture an image of a web page so that I can use the thumbnail image to preview a page. There are sites which offer this service like websnapr.com, kwiboo.com and shrinktheweb.com. I would like to instead do it myself and leverage Firefox (Gecko) and Safari (WebKit) to render the image.
Is there anything available to do this currently? Is there a C# project that hooks into Gecko and/or WebKit to create images of a loaded web page.
My project is called WebPreview and it uses the WebBrowser control from the .NET Framework, but since that can be a bit outdated the rendered screenshots will not look as accurate as a recent Gecko or WebKit build.
http://www.smallsharptools.com/Projects/WebPreview/
Please post a comment for any Open Source projects which can help me.
I use a Firefox add-on called Screengrab
checkout http://browsershots.org/ its free and open. it says somewhere on the site what plugins and techniques they use...
You can look a this project http://www.codeplex.com/url2jpeg. It uses Internet Explorer.

Howto draw "pages" in a C# WinForms project

I want to display data on a Windows Forms project in C#.
The general sketch for the GUI is similar to Acrobat Reader or MS Word - meaning i want to display the data on several pages, and let the user navigate between the pages. The data i`m displaying isn't special, i just want to give the user a "page" feeling when viewing it.
I`m searching for a good starting point, preferably open-source.
I thought about using some kind of a reporting tool, such as Crystal Reports, is that a good idea?
Also, is better to use WPF then WinForms for this?
Any thought and recommendations are welcome.
Thanks.
It sounds like you would be better off going the WPF route. You have MUCH better control over how your "form" looks.
What you would want to do is define each "page" in a user control or something, then you can display each one however you like. WPF can handle the zooming for you, all you have to do is hook it up (look into transforms). I can't see WinForms doing this. I would suggest looking at this project on codeplex.
If this project is just for fun, and if you already are using Visual Studio 2008, then WPF is a good choice for this.
If you intend to make this a commercial project, however, I would recommend making it a WinForms application. WPF requires Visual Studio 2008 and .Net 3.5. Many Windows users (especially corporate customers) are still using .Net 2.0 and don't plan to upgrade soon. Some are even still on .Net 1.1 (or no .Net at all). .Net 2.0 comes pre-installed now on new PCs, and the installer for 2.0 is only 23 MB (versus close to 200 MB for the somewhat-buggy .Net 3.5 installer). Also, .Net apps can (potentially) be made to run on Mac, Linux and the iPhone thanks to Mono, but Mono now is somewhere between .Net 2.0 and .Net 3.5, so WPF applications can't be cross-platform yet.
Here is a previous answer to a sort-of-similar question about doing a zoom effect in .Net with GDI+:
Auto sizing zoom on an image in .NET
This should give you a start on doing this kind of graphics work in .Net (and it's as open source as it gets).
Update: If you want to render XPS documents (easily), then you should use WPF. However, this choice would effectively eliminate the possibility of making your application cross-platform via Mono, at least in the short-term.
An alternative would be to export your documents as PDF files, or use Adobe Acrobat to convert your XPS documents into PDF files. Here is a link to a CodeProject sample that renders PDFs entirely in C#/.Net 2.0 or older:
http://www.codeproject.com/KB/showcase/pdfrasterizer.aspx
This code would allow your WinForms application to render a PDF file as a collection of Bitmaps (one for each page), and from there it's a relatively simple matter to display these Bitmaps in the manner you describe (with zoom and everything). Because the project would use .Net 2.0, it should work in Mono without any modifications.
TabControl doesn't do what you want?
It sounds like what your trying to do is make an application behave like a web page. Would just adding a WebBrowser control suffice ?

Categories