Multiple URLs

How to publish my PDF files that are on my server, for each PDF document I have a separate URL, I use syncfusion PDF viewer xamarin, I need an example. Thanks !!


1 Reply

SP SarathKumar Prakash Syncfusion Team December 10, 2021 03:16 PM UTC

Hi Alexandru,

Greetings from Syncfusion support,  
You can convert URL to stream and load that stream in PdfViewer control using below code snippet


 
var cancellationTokenSource = new CancellationTokenSource(); 
            HttpClient client = new HttpClient(); 
            { 
                HttpResponseMessage response = await client.GetAsync(URL, HttpCompletionOption.ResponseHeadersRead, cancellationTokenSource.Token); 
                { 
                    var m_pdfDocumentStream = await response.Content.ReadAsStreamAsync(); 
                    MemoryStream ms = new MemoryStream(); 
                    await m_pdfDocumentStream.CopyToAsync(ms); 
                    pdfViewerControl.LoadDocument(ms); 
                } 
            } 
 
Regards,
Sarath Kumar.
 


Loader.
Up arrow icon