Hi, the Load method in PDF Viewer Control is taking 9 seconds for a PDF file of 10 MB to load. How can we optimize it to reduce this time to upto 1 second?
I am first reading all bytes from the file, converting it into stream and then loading the file for preview.
The code for reference is given below.
if (jsonObject != null && (jsonObject.ContainsKey("document") || jsonObject.ContainsKey("documentId")))
{
string documentPath = fileName;
// Get byte array
var bytes = RepositoryFactory.GetRepositoryFatoru().GetFileRepository(organization.OrganizationId).GetFileBytes(documentPath);
if (bytes != null)
{
stream = new MemoryStream(bytes);
}
else
{
return (documentPath + " is not found");
}
}
jsonResult = pdfviewer.Load(stream,jsonObject);
var response = JsonConvert.SerializeObject(jsonResult);
return response;