Telerik Forums
UI for Xamarin Forum
1 answer
83 views

This was working fine in a Xamarin Forms (UWP) project

        public void PrintReferralReport(byte[] pdf)
        {
            pdfCurrent = pdf;
            this.pdfViewer.Source = pdf;
            memberReferralPopUpVM.IsPDFGridVisible = true;

        }

<telerikPdfViewer:RadPdfViewer x:Name="pdfViewer" Grid.Row="1"/>

As soon as Telerik.Documents.Core was added to a different project (doesn't even have to be used), the viewer stopped appearing.

<PackageReference Include="Telerik.Documents.Core" Version="2022.3.1108" />

<PackageReference Include="Telerik.UI.for.Xamarin" Version="2022.3.1109.1" />
Didi
Telerik team
 updated answer on 21 Nov 2022
1 answer
292 views
I am working on a xamarin application, I have to display Pdf and Docx files within the application, for Pdf I am using telerik PdfViewer, but can't find a telerik control to display docx within the application. Is there any telerik control to display docx files within the application?
Didi
Telerik team
 answered on 17 Jan 2022
1 answer
74 views
How would I add a close button to the toolbar.  This seems a standard button folks would want
Yana
Telerik team
 answered on 02 Nov 2021
0 answers
181 views
Telerik.ui.for.Xamarin v 2021.1.224.1

System.MethodAccessException: Method `Telerik.Windows.Documents.Fixed.Utilities.Rendering.PageLayoutHelper.CalculatePageBoundingRectangle(Telerik.Windows.Documents.Fixed.Model.Common.IFixedPage)' is inaccessible from method `Telerik.XamarinForms.PdfViewer.PdfUtilities.GetPageSize(Telerik.Windows.Documents.Fixed.Model.RadFixedPage)'
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_throw_method_access(intptr,intptr)
  at Telerik.XamarinForms.PdfViewer.PdfUtilities.GetPageSize (Telerik.Windows.Documents.Fixed.Model.RadFixedPage page) [0x00000] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.TryGetSameHeight (Telerik.Windows.Documents.Fixed.Model.Collections.PageCollection pages) [0x0001b] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.TryCreatePageTuple (Telerik.XamarinForms.PdfViewer.DocumentInfo documentInfo) [0x0004d] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.UpdatePageInfos () [0x00024] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.Presenters.VerticallyStackedPagesStrategy.OnDocumentChanged () [0x00000] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.FixedDocumentContinuousPresenterV2.OnDocumentInfoChangedOverride () [0x00025] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.FixedDocumentPresenterBase.set_DocumentInfo (Telerik.XamarinForms.PdfViewer.DocumentInfo value) [0x00010] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.OnDocumentInfoChanged (Telerik.XamarinForms.PdfViewer.DocumentInfo oldValue, Telerik.XamarinForms.PdfViewer.DocumentInfo newValue) [0x00009] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.set_DocumentInfo (Telerik.XamarinForms.PdfViewer.DocumentInfo value) [0x00017] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.OnDocumentChanged () [0x00015] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.OnPropertyChanged (System.String propertyName) [0x0000d] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00114] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:510 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x00173] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) [0x0004d] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:374 
  at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindablePropertyKey propertyKey, System.Object value) [0x0000e] in D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:356 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.SetDocument (Telerik.Windows.Documents.Fixed.Model.RadFixedDocument value) [0x00000] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.UpdateDocumentFromSource () [0x0001a] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.RadPdfViewer.Source_PropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00012] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.Common.NotifyPropertyChangedBase.OnPropertyChanged (System.String propertyName) [0x00015] in <1c319f0f665e4035ab8e82495214d254>:0 
  at Telerik.XamarinForms.PdfViewer.DocumentSource.set_Document (Telerik.Windows.Documents.Fixed.Model.RadFixedDocument value) [0x0002c] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.DocumentSource.SetDocumentStreamTuple (Telerik.XamarinForms.PdfViewer.DocumentStreamTuple value) [0x0001e] in <136b85164c274f2fa1cf0f48d0e3f200>:0 
  at Telerik.XamarinForms.PdfViewer.StreamDocumentSource+<>c__DisplayClass18_1.<UpdateDocumentFromStreamFunc>b__2 () <0x153447728 + 0x00056> in <136b85164c274f2fa1cf0f48d0e3f200#897a8708db8305ecb598233d4a92b40f>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/azdo/_work/2/s/xamarin-macios/src/Foundation/NSAction.cs:152 
  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/azdo/_work/2/s/xamarin-macios/src/UIKit/UIApplication.cs:86 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Users/builder/azdo/_work/2/s/xamarin-macios/src/UIKit/UIApplication.cs:65 
  at Kpmg.Constellation.Mobile.iOS.Application.Main (System.String[] args) [0x00002] in /Users/ananeabdeljalil/GitSource/myPulseV2/Constellation.Mobile/src/Kpmg.Constellation.Mobile.iOS/Main.cs:18 
Mondher
Top achievements
Rank 1
 asked on 20 May 2021
2 answers
413 views

Hi,

I have developed an Xamarin application that in Modal show a pdf in a PdfViewer.

PdfViewerPage pdfViewer = new PdfViewerPage(item.IdAllegato, item.Path, item.FlagScaricabile);
Navigation.PushModalAsync(pdfViewer);

 

When the Modal is open, I assign a url to the PdfViewer source.

pdfViewer.Source = new Uri(uri);

 

Everything is fine when I run the android app on debug mode, but when I run in release mode the PdfViewer show this message: "an error occurred while loading the document"

n/a
Top achievements
Rank 1
 answered on 07 Apr 2021
1 answer
866 views

I'm using RadPdfViewer control to show pdf document in our Xamarin form app. The app is working fine on Android(device and Simulator) and also on iOS simulator.
But App is crashing on iPhone device while launching the app. I'm getting the below error

 

Failed to force load assembly Telerik.XamarinForms.DataGrid.dll. Type:Telerik.XamarinForms.DataGrid.DataGridLocalizationManager.

Exception: 'You MUST call Xamarin.Forms.Init(); prior to using it.'. Callstack: '  at Xamarin.Forms.Device.get_PlatformServices () [0x00007] in D:\a\1\s\Xamarin.Forms.Core\Device.cs:87 
  at Xamarin.Forms.Device.get_RuntimePlatform () [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Device.cs:57 
  at Telerik.XamarinForms.Common.RadDevice..cctor () <0x10c1fc1c8 + 0x00002> in <81c15264f2164ef79a02e84ed79e8bfd>:0

If I comment out the <telerikPdfViewer:RadPdfViewer x:Name="pdfViewer" /> control in the .xaml file the app loads properly

I have tried the solution provided on TelerikForm.Init() but it's not worked for me.
Lance | Manager Technical Support
Telerik team
 answered on 02 Feb 2021
2 answers
589 views
Once we display the PDF in the viewer, how can the user to print it in a UWP app?
Neil N
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 06 Jan 2021
4 answers
264 views

I'm using the pdf viewer in a xamarin solution, which includes a UWP application. A pdf can be displayed no problem on the UWP app, however as soon as a mouse scroll is done (to try and scroll down in the pdf, for example), the application crashes without any error message or other signs for what went wrong. Breakpoints and debugging mode in visual studio haven't helped identify the issue. 

Is this a known problem with the pdf viewer component? Any advice on a resolution would be much appreciated.

Yana
Telerik team
 answered on 16 Nov 2020
2 answers
251 views

Hello. I'm trying to implement a control for displaying Terms and Conditions on my app using PDFViewer. I want to have an "accept" button below the viewer that Will become enabled when the user has scrolled to the bottom of the PDF (and hopefully read the document).

For this I would like to know the page number the user is currently Reading, and perhaps also an event that fires when it changes. Is this available in the PDFViewer control? I found references to VerticalScrollState, but that seems to only be available for Windows (is that right?)

What would be the correct approach to get this behavior on Xamarin Forms? Thank you

 

Joaquin
Top achievements
Rank 2
 answered on 03 Jan 2020
1 answer
267 views

Xamarin.Forms 4.1.0.555619

Telerik.Ui.for.Xamarin 2019.3.1119.1

Hey,

I am trying to show a pdf from a stream via the pdfViewer,

<Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="Auto"/>
             <RowDefinition />
         </Grid.RowDefinitions>
         <telerikPdfViewer:RadPdfViewerToolbar PdfViewer="{Binding Source={x:Reference pdfViewer}}">
             <telerikPdfViewer:ZoomInToolbarItem />
             <telerikPdfViewer:ZoomOutToolbarItem />
             <telerikPdfViewer:ToggleLayoutModeToolbarItem />
         </telerikPdfViewer:RadPdfViewerToolbar>
         <telerikPdfViewer:RadPdfViewer x:Name="pdfViewer"
                                Grid.Row="1"
                                        Source="{Binding DocStream, Mode=TwoWay}"
                                PageSpacing="15"
                                MinZoomLevel="0.2"
                                MaxZoomLevel="5" />
     </Grid>

 

The view renders but there is no pdf, just a grey blank screen, there is no crash however the console output gives the following;

Im thinking SkiaSharp? but at a loss as to a solution?

Failed to bind EAGLDrawable: <CAEAGLLayer: 0x2866d0640> to GL_RENDERBUFFER 1
Failed to make complete multisample framebuffer object 8cd6
Failed to make complete framebuffer object 8cd6
Yana
Telerik team
 answered on 11 Dec 2019
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?