Declined
Last Updated: 27 Aug 2021 09:10 by ADMIN

If you download the pdf document from the internet, save it to the device and try to show it inside PdfViewer, it will not be loaded on Xiaomi phones with MIUI 12.1. and above.

Users report similar issues with downloaded files on MIUI devices, here are a few discussions on the matter:

https://www.reddit.com/r/Xiaomi/comments/l3x5db/miui_12130_broke_file_permissions_on_mi10_lite/

https://www.reddit.com/r/Xiaomi/comments/mx05ur/file_downloading_issues_on_my_xiaomi/

It seems that's the same reason for the PdfViewer not showing downloaded pdf files as it properly shows pdf documents added as embedded resource to the solution.

Declined
Last Updated: 19 Nov 2020 13:20 by Chris

System.MissingFieldException: Field not found: Telerik.XamarinForms.SkiaSharp.SkiaDocumentView.purePainter Due to: Could not parse field signature 0a00031b due to: Could not resolve type with token 0100014e from typeref (expected class 'Telerik.XamarinForms.SkiaSharp.DocumentView.SkiaDocumentPurePainter' in assembly 'Telerik.XamarinForms.SkiaSharp, Version=2020.3.1106.460, Culture=neutral, PublicKeyToken=null') assembly:Telerik.XamarinForms.SkiaSharp, Version=2020.3.1106.460, Culture=neutral, PublicKeyToken=null type:Telerik.XamarinForms.SkiaSharp.DocumentView.SkiaDocumentPurePainter member:(null)
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.UpdatePresenter () [0x00037] in <bd15b7ab3df742a5908d5d151a9a58d8>:0
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer..ctor () [0x00048] in <bd15b7ab3df742a5908d5d151a9a58d8>:0
  at OnaMobile.Views.PdfViewPage.InitializeComponent () [0x00012] in C:\Users\chris\Work\ONAMA\onama-mobile-app\OnaMobile\OnaMobile\obj\Debugetstandard2.0\Views\PdfViewPage.xaml.g.cs:22
  at OnaMobile.Views.PdfViewPage..ctor () [0x00008] in C:\Users\chris\Work\ONAMA\onama-mobile-app\OnaMobile\OnaMobile\Views\PdfViewPage.xaml.cs:19
  at OnaMobile.ViewModels.ResourcesPageViewModel.OpenResourceAsync (OnaMobile.OnlineResources.ResourceLink resource) [0x001ac] in C:\Users\chris\Work\ONAMA\onama-mobile-app\OnaMobile\OnaMobile\ViewModels\ResourcesPageViewModel.cs:186

iOS SDK 14.1, ARM64. Happens regardless of Linker Behavior setting.

The page itself has nothing in its code-behind other than the default constructor calling InitializeComponent(). In the XAML, the RadPdfViewer control is in a two-row, one-column grid, where it is in the second row:

<Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" ColumnSpacing="0" RowSpacing="0">
    <Grid.RowDefinitions>
        <RowDefinition Height="60" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <Frame Grid.Row="0"><!-- ... --></Frame>

    <pdf:RadPdfViewer Grid.Row="1" HorizontalOptions="Fill" VerticalOptions="FillAndExpand" Source="{Binding Source}" />
</Grid>
The view model has a DocumentSource property Source and implements INotifyPropertyChanged. However the exception occurs before the BindingContext of the page is set to the view model.