Load pdf from recources

Hello ,

Last time Satheesh Palanisamy helpt me download an Pdf and show it in pdfdviewer.

But how do i show a pdf from recources ?


This code i use to download 


                        pdfViewerControl.IsVisible = true;
                        HttpClient client = new HttpClient();

                        var response = await client.GetAsync("https://www.vvofb.nl/wp-content/uploads/2020/01/Aanmeldformulier-Vrienden-van-vv-OFB.pdf/");
                        var bytes = await response.Content.ReadAsByteArrayAsync();

                        Stream stream = new MemoryStream(bytes);
                        pdfViewerControl.LoadDocument(stream);
                        picker.IsVisible = false;
                        Labelkeuze.IsVisible = false;


But in Recources i have a pdf with the name Balsponsorkosten.pdf how do i show this in Pdfviewercontrole

The build action is AndroidAsset.

2 Replies 1 reply marked as answer

AV Ashokkumar Viswanathan Syncfusion Team September 4, 2020 07:16 AM UTC

Hi Boris, 
 
Thank you for contacting support, 
 
We have prepared the sample to load the PDF document from the resource folder in to the SfPdfViewer control.  
 
 
Please find the UG documentation for further details, 
 
Loading a PDF in code-behind/programmatically : 
 
Loading a PDF using MVVM binding : 
 
Kindly try the above sample and let us know whether the above solution resolved the query. 
 
Regards, 
Ashok Kumar Viswanathan. 


Marked as answer

BO Boris Oprit September 4, 2020 02:31 PM UTC

Ashok Kumar Viswanathan ,

Works  , with an sample it is beter understand the code.


Thanks

Loader.
Up arrow icon