Hi Christiaan,
Thank you for contacting Syncfusion support.
We were unable to reproduce the reported issue with the provided details in our PDF Viewer. We have shared the sample in which we have tried to reproduce the issue in the below link,
Please try it and revert us with more details about your issue and the modified sample if you still have concerns.
Regards,Akshaya
|
[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));
} |