Not able to Load multiple PDFs together

Hi Team,

We have enterprise license for Syncfusion and we are trying to load multiple PDF files on same page using PDF Viewer.
We are loading files from the Azure Blob storage, what we are facing issue is when we load all files in all viewers, all viewer is showing the same and last PDF file only.
We have verified that we are getting accurate file stream/data from blob for all different files and the function we have created to load pdf file to viewer is also recieving the correct content of the file.

3 Replies

AA Akshaya Arivoli Syncfusion Team July 27, 2020 11:38 AM UTC

Hi Christiaan , 

Thank you for contacting Syncfusion support. 

Based on the provided details, we suspect that the reported issue is due to position of the stream in the load method. So, can you please add the below highlighted line in the load method of the controller class.  

[System.Web.Mvc.HttpPost] 
        public ActionResult Load(jsonObjects jsonObject) 
        { 
            PdfRenderer pdfviewer = new PdfRenderer();            
            MemoryStream stream = new MemoryStream(); 
            var jsonData = JsonConverter(jsonObject); 
            object jsonResult = new object(); 
            if (jsonObject != null && jsonData.ContainsKey("document")) 
            { 
                if (bool.Parse(jsonData["isFileName"])) 
                { 
                    string documentPath = GetDocumentPath(jsonData["document"]); 

                    if (!string.IsNullOrEmpty(documentPath)) 
                    { 
                        byte[] bytes = System.IO.File.ReadAllBytes(documentPath);                       
                        stream = new MemoryStream(bytes); 
                    } 
                    else 
                    { 
                        string fileName = jsonData["document"].Split(new string[] { "://" }, StringSplitOptions.None)[0]; 
                        if (fileName == "http" || fileName == "https") 
                        { 
                            var WebClient = new WebClient(); 
                            byte[] pdfDoc = WebClient.DownloadData(jsonData["document"]); 
                            stream = new MemoryStream(pdfDoc); 
                        } 
                        else 
                        { 
                            return this.Content(jsonData["document"] + " is not found"); 
                        } 

                    } 
                } 
                else 
                { 
                    byte[] bytes = Convert.FromBase64String(jsonData["document"]); 
                    stream= new MemoryStream(bytes);                     
                    
                } 
            } 
stream.Position = 0;  
            jsonResult = pdfviewer.Load(stream, jsonData); 
            return Content(JsonConvert.SerializeObject(jsonResult)); 
        } 

If you are still facing the issue, can you please provide the sample and the replication procedure. So that would be helpful for us to analysis more and assist you better.  

Regards, 
Akshaya  




CC Christiaan Collier July 27, 2020 04:22 PM UTC

Hi Akshaya Arivoli,

We have already applied that before but still it's not working.
Can anyone in the support team have a quick meeting with us? Or can we find any other solution, as this solution is not working.


AA Akshaya Arivoli Syncfusion Team July 28, 2020 11:13 AM UTC

Hi Christiaan , 

A support incident to track the status of your query has been created under your account. Please log on to our support website to check for further updates 



Regards, 
Akshaya 


Loader.
Up arrow icon