public partial class CvView : ContentPage
{
DocumentViewModel cv;
public CvView()
{
InitializeComponent();
BindingContext = cv = new DocumentViewModel();
}
protected override void OnAppearing()
{
base.OnAppearing();
// this works with actual pdf. extract doc downloader from backup in android and rename the name space
Stream documenStream = DependencyService.Get().DownloadPdfStream(cv.DocUrl, "CvFile");
//Loads the PDF document as Stream to PDF viewer control
pdfViewerControl.LoadDocument(documenStream);
}
}
Forum is being wacky and wont let me edit my initial post. the CS is good.. bu tthe PDF XAML is below
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App.Views.CvView"
xmlns:sfpdfviewer="clr-namespace:Syncfusion.SfPdfViewer.XForms;assembly=Syncfusion.SfPdfViewer.XForms"
Padding="0,0,0,0"
Title="CV">
<ContentPage.Content>
<StackLayout VerticalOptions="Start" HorizontalOptions="Fill
" Orientation="Vertical">
<Grid IsVisible="{Binding DisplayDoc}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<sfpdfviewer:SfPdfViewer x:Name="pdfViewerControl" Grid.Row="1" HorizontalOptions="Fill" VerticalOptions="Fill">
</sfpdfviewer:SfPdfViewer>
</Grid>
</StackLayout>
</ContentPage.Content>
</ContentPage>
An update - I have managed to avoid the constant re-downloading by moving the code out of the OnAppearing function.
Still not sure how to be able to horizontal swipe between screens of the tabbedView.
Thanks for this. It does indeed work when I run it. However, when I copy it into my solution, to only works if I swipe on the top 20px padding. Something in my solution is hijacking the swipe but I can't find what.
Any tips of what I should look for (I know that is a broad question) I'm trying to get this work for Android in the first instance/
Thanks
I stripped back a copy of my entire solution to be a carbon copy of the pages in the sample... still no good.
I did notice that I am using a newer version of XF - 2.4.0.282. The sample is using 2.3.x
Good news - that means it's fixable! I have attached a stripped down version of my project. Problem still exists and it is basically an import of your sample so should be easy enough to work out what is stopping it from working.
I had to remove the packages to get it under the 30MB limit. Let me know if that presents a problem for you and I can work out a way to get it to you with the packages intact.
Thanks again
Shaun
I've been using the same emulator for both your sample and my app. Its using Android 7 with device of Nexus 10.
I have tried to run this on my Pixel C also running Android 7 with the same issue.