We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Load PDF failed

Dear community,

since 2 hours im trying to load an pdf through stream or local file into my pdf viewer.
everytime im getting an exception: "The given key was not present in the dictionary".

This exception occurs when im executing following method "var output = helper.ProcessPdf(jsonResult);"


My View:

@using Syncfusion.JavaScript.PdfViewerEnums
 
@{
    ViewBag.Title = "Rechnungsansicht";
}
 
<h2>Rechnungsansicht</h2>
 
@Html.EJ().PdfViewer("invoicePdfViewer").ServiceUrl("/Invoice").PdfService(PdfService.Local);

My Controller action:

public object PostViewerAction(Dictionary<stringstring> jsonResult)
       {
           if (Request?.UrlReferrer != null)
           {
               var invoiceIdStr = HttpUtility.ParseQueryString(Request.UrlReferrer?.Query)["invoiceId"];
 
               if (string.IsNullOrEmpty(invoiceIdStr))
                   throw new Exception("Rechnung nicht gefunden!");
 
               var invoiceId = Convert.ToInt32(invoiceIdStr);
 
               var helper = new PdfViewerHelper();
 
               //var t = new Thread(GetInvoicePdf);
               //t.SetApartmentState(ApartmentState.STA);
 
               //t.Start(invoiceId);
               //t.Join();
 
               helper.Load(@"C:\tmp\R000001.pdf");
 
               var output = helper.ProcessPdf(jsonResult);
               var response = JsonConvert.SerializeObject(output);
               return response;
           }
 
           return null;
       }

Please help me!

Thanks!

Regards,

Andre

1 Reply

SA Sabari Anand Senthamarai Kannan Syncfusion Team August 8, 2016 10:12 AM UTC

Hi Andre, 
 
Thank you for choosing Syncfusion products. 
 
We have created a new incident under your account for your queries in your last update. We request you to follow the new incident for further updates. You can log in to our support system using the following link,  
  
 
Regards, 
Sabari Anand

Loader.
Up arrow icon