RadPdfViewer stops working when Telerik.Documents.Core added

1 Answer 85 Views
PdfViewer
Neil N
Top achievements
Rank 1
Iron
Veteran
Iron
Neil N asked on 18 Nov 2022, 07:31 PM | edited on 18 Nov 2022, 07:32 PM

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" />

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 21 Nov 2022, 07:35 AM | edited on 21 Nov 2022, 07:49 AM

Hi Neil,

Could you please elaborate why you reference both packages in the project? Telerik UI for Xamarin NuGet has a reference to the Telerik.UI.for.Xamarin.Documents.Core package.

If you want to add the Documents.Core package as nuget to a Xamarin project, you have to use the Telerik.UI.for.Xamarin.Documents.Core, not Telerik.Documents.Core.

Here are the references I have in the .csproj file:

  <ItemGroup>
    <PackageReference Include="Telerik.UI.for.Xamarin" Version="2022.3.1109.1" />
    <PackageReference Include="Telerik.UI.for.Xamarin.Documents.Core" Version="2022.3.1108" />
    <PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
    <PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
  </ItemGroup>

The pdf document is displayed as expected.

If you manually adding the references to the project, then you should add the Core.dll.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Neil N
Top achievements
Rank 1
Iron
Veteran
Iron
commented on 21 Nov 2022, 02:05 PM

Hi Didi,

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

The Xamarin project has no reference to Document.Core. 

<PackageReference Include="Telerik.UI.for.Xamarin" Version="2022.3.1109.1" />

is the version of Telerik UI for Xamarin we're using in the Xamarin Forms project.

 

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

is what we're using in a cross platform .NET Standard library project

Didi
Telerik team
commented on 24 Nov 2022, 12:50 PM

Hi Neil,

I have tested the scenario. I have two different projects and there isn't a reference between them. The first project is a Xamarin.Forms blank project with PdfViewer in it. The second project is a class library project with Telerik.Documents.Core added to it. The Xamarin project works as expected and the pdf viewer displays the document.

Please explain what does different project mean? Send me both projects so I can further research the case. If you do not want to send them in the forum, open a support ticket and attach the projects to it. 

Also on which platform the behavior occurs.

 

Tags
PdfViewer
Asked by
Neil N
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Didi
Telerik team
Share this question
or