Hi Nguyen,
Thank you for contacting Syncfusion support.
We can save the PDF document in the server side in the Download() web action method of the PDF Viewer server library. Please find the code snippet for the same from the below,
Code snippet:
public IActionResult Download([FromBody] Dictionary<string, string> jsonObject)
{
PdfRenderer pdfviewer = new PdfRenderer(_cache);
string documentBase = pdfviewer.GetDocumentAsBase64(jsonObject);
string base64String = documentBase.Split(new string[] { "data:application/pdf;base64," }, StringSplitOptions.None)[1];
if (base64String != null || base64String != string.Empty)
{
byte[] byteArray = Convert.FromBase64String(base64String);
System.IO.File.WriteAllBytes(_hostingEnvironment.WebRootPath + "\\output.pdf", byteArray);
}
return Content(string.Empty);
} |
We have created the sample for the same and shared in the following location,
In the above sample clicking on the download icon in the default toolbar will save the PDF document in the server.
Please try this and revert us with more details if you have any concerns on this.
Regards,
Akshaya