I wrote a controller based on the example here:
https://www.syncfusion.com/kb/10343/how-to-use-ej2-pdf-viewer-in-razor-pages, but adjusted the code for a web api controller. I have the following action (this.cache is an injected IMemoryCache):
[HttpPost]
public IActionResult RenderPdfPages([FromBody] Dictionary<string, string> jsonObject)
{
using (var pdfviewer = new PdfRenderer(this.cache))
{
var jsonResult = pdfviewer.GetPage(jsonObject);
return this.Content(JsonConvert.SerializeObject(jsonResult));
}
}
After a successful Load action is returned to the front end, the above method gets called with the following jsonObject parameter:
{"xCoordinate":"0","yCoordinate":"0","viwePortWidth":"1583","viewportHeight":"640","pageNumber":"0","hashId":"\b['?>?t???????v?","tilecount":"1","zoomFactor":"1","action":"RenderPdfPages","uniqueId":"Sync_PdfViewer_8ae71a9c-18da-4931-0863-405f0f8cc5af","documentId":"xxxxxx.pdf"}
The jsonResult after GetPage is called is:
The given key '1' was not present in the dictionary.
While setting breakpoints in the code, I see that the memory cache does have the key that is provided in the jsonObject's hashId property with a value that is a syncfusion cache entry. So, there does not seem to be anything missing from the cache.
Do you have any more info about what the error could be describing?