I'm creating an app to show some local PDF files to the user.
The app has 2 functions:
Show the local PDF (pdf viewer).
Make an "Interactive summary" so the user can navigate between the pages of the PDF.
In Android I'm using 'PDF.JS' plugin for xamarin, to show all the pdf files and it is working fine. I can easily open the PDF in the page I want by using the "Interactive summary".
On the other hand, in IOS I'm using a webview to show the pdf. The only problem is when creating the "Interactive Summary" for IOS I can't figure out how to open the PDF file in the page I want. There is any library or function that grants me access to it (pdf pages)?
I'm attaching some screenshots of the code so you guys can understand what's happening.
I would suggest using Syncfusion PDF.
It has already all the functionalities you want:
<Grid x:Name="pdfViewGrid">
<syncfusion:SfPdfViewer x:Name="pdfViewerControl" InputFileStream="{Binding PdfDocumentStream}"/>
</Grid>
To change the page:
<Button x:Name="goToNextButton" Grid.Column="3" BackgroundColor="Transparent" Image="PageDown.png" HorizontalOptions="Center" VerticalOptions="Center" Command="{Binding GoToNextPageCommand, Source={x:Reference Name=pdfViewerControl}}"/>
<Button x:Name="goToPreviousButton" Grid.Column="4" BackgroundColor="Transparent" Image="PageUp.png" HorizontalOptions="Center" VerticalOptions="Center" Command="{Binding GoToPreviousPageCommand, Source={x:Reference Name=pdfViewerControl}}"/>
Related
Is there any technique to render the images more clearly in MAUI, like RenderOption in WPF.
My image must be like this:
and it is rendered like this:
Edit: This project will run only on Windows Desktop and MacCatalyst. This behavior is happening on Windows device.
The OS is Windows 11 x64
Image xaml:
<Border
Grid.Row="1"
Margin="3"
HeightRequest="140"
StrokeShape="RoundRectangle 1,1,1,1"
WidthRequest="140">
<Border.Stroke>Black</Border.Stroke>
<Border.StrokeThickness>0.3</Border.StrokeThickness>
<Image
Margin="1"
Aspect="AspectFill"
Background="{StaticResource Gray100}"
HeightRequest="130"
HorizontalOptions="Center"
Source="{Binding MyImage}"
VerticalOptions="Center"
WidthRequest="130" />
</Border>
In action:
As a summary, I will post an answer so that it will help others who have similar problems. Thanks for your support and feedback #ValiMatie.
The posted issue is here: https://github.com/dotnet/maui/issues/10916 .
And it has been moved to Backlog milestone. This means that it is not going to be worked on for the coming release.
I'm developing a xamarin.forms app for my company but I have a stranger problem.
When I try to load in a stackLayout another content page, xamarin.forms doesn't load correctly the page. Probably because the page that I try to load is too big, infact if I try to load a smaller page It works correctly. (I Can't load a smaller page because I need to get a lot of data from user).
BigPage bigpage = new BigPage(defaultData);
stackLayout.Children.Clear();
stackLayout.Children.Add(bigpage);
This is what I see
In your opinion, what is the best way to solve this problem?
When the page does not load correctly, if I click on a component that opens the keyboard (like <entry>), the system loads the page correctly even if it is big.
I find a solution. It's not the best solution but it works.
It was my XAML code:
<ScrollView>
<StackLayout>
<StackLayout x:Name="stackLayout" Padding="15" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="GhostWhite" />
</StackLayout>
</ScrollView>
And It is my C# code:
BigPage bigpage = new BigPage(defaultData);
stackLayout.Children.Clear();
stackLayout.Children.Add(bigpage);
In order to solve this problem I add in the end of the page an empty label. In this way I can load the page without problem.
<ScrollView>
<StackLayout>
<StackLayout x:Name="stackLayout" Padding="15" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" BackgroundColor="GhostWhite" />
<Label Text=" " HorizontalOptions="End"/>
</StackLayout>
</ScrollView>
I use zxing.mobile.forms nuget package.
The QR-Code is perfectly displayed on the screen display, but I also need to save this QR-Code in the gallery.
Can I convert it to image for further use? Can I save it right away, since it seems to be an image?
code in xaml:
<zxing:ZXingBarcodeImageView IsVisible="False" x:Name="qrcode"
BarcodeFormat="QR_CODE" WidthRequest="200" HeightRequest="200" BarcodeValue="1">
<zxing:ZXingBarcodeImageView.BarcodeOptions>
<zxingcommon:EncodingOptions Height="200"
Width="200">
</zxingcommon:EncodingOptions>
</zxing:ZXingBarcodeImageView.BarcodeOptions>
</zxing:ZXingBarcodeImageView>
I'm working on a WPF application and am trying to embed a twitch/youtube/facebook gaming stream. I am relatively new to WPF applications in general.
I've followed the steps outlined at the Twitch Embed API Page, and attempted to insert it into a CEFSharp window using the Twitch embed code. However, as of 2020, twitch now requires a "parent" field to embed their videos, so I just tried plugging the actual twitch page into the CEFsharp element and still it gave me an error.
For Facebook and Youtube, I could get the embedded frames to show up as well, but they both failed to load the video, which leads me to believe there is an issue displaying streaming media through CEFSharp?
Here is the code :
...
xmlns:cef="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
...
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.twitch.tv/shroud"
/>
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.youtube.com/embed/Xz5Nw0EY5ng"
/>
<cef:ChromiumWebBrowser
Width="480"
Height="270"
HorizontalAlignment="Left"
Margin="0,20,0,0"
Address="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2FNitroLukeDX%2Fvideos%2F710121262901568%2F&show_text=0&width=560" />
And here's the result:
Any help would be greatly appreciated!
Ahaa in the end someone pointed me towards the new WebView2 control from ms.
This plays streaming video :D
<wv2:WebView2 Name="webView"
HorizontalAlignment="Left"
Height="270"
Width="480"
Margin="0,20,0,0"
Source="https://player.twitch.tv/channel=loltyler1"/>
I'm using the ImageButton and would like that by taking the image by source it fills every button. The problem is that the image appears small simply on the right side. I want it to occupy every button
<ContentView.Content>
<StackLayout>
<controls:ImageButton x:Name="CmdVoltar" BackgroundColor="#1C97D5" TextColor="White" FontSize="Small" WidthRequest="100" HeightRequest="40" HorizontalOptions="EndAndExpand" Margin="0,0,50,0"></controls:ImageButton>
</StackLayout>
</ContentView.Content>
CmdVoltar.Source = ImageSource.FromResource("Agmovel.Img.btnVoltar.png");
I would suggest not using the default button with images, it has several issues.
You can use a package such as https://github.com/robinmanuelthiel/flexbutton