|
Rank: Newbie Groups: Member
Joined: 9/19/2018 Posts: 7
|
I'm trying to use MVCToPDF in a MVC Core application. Whenever I try to do anything, I get a NullReferenceException error (or similar, depending on what I'm doing):
NullReferenceException: Object reference not set to an instance of an object. EO.Pdf.Mvc.MVCToPDF+d.a()
Stack Query Cookies Headers NullReferenceException: Object reference not set to an instance of an object. EO.Pdf.Mvc.MVCToPDF+d.a() EO.Pdf.Mvc.MVCToPDF.set_ResultFileName(string value) Mobility.Platform.Client.Mosaiq.Tiles.SignatureTile.SignatureTileController.SubmitForm(SignatureTileModel m) in SignatureTileController.cs + MVCToPDF.ResultFileName = "SignatureTile";
Here's my code:
This is in my Startup class:
MVCToPDF.RegisterFilter(typeof(GlobalFilters));
This is in my cshtml file:
@using (Html.BeginForm("SubmitForm", "SignatureTile", FormMethod.Post)) { <div> @*https://help.syncfusion.com/api/js/ejsignature*@ <div id="signature"></div> <script>
// Create signature $('#signature').ejSignature({ backgroundColor: "yellow", height: "400px", isResponsive: true }); </script> </div> <div class="main-Background"> <button type="submit" id="btnSave">Save</button> </div>
And this in my controller:
[System.Web.Mvc.HttpPost, RenderAsPDF(AutoConvert = false)] public System.Web.Mvc.ActionResult SubmitForm(SignatureTileModel m) { MVCToPDF.ResultFileName = "SignatureTile"; MVCToPDF.RenderAsPDF(AfterConvert);
//return View("SignatureTile", m); return null; }
static void AfterConvert(object sender, EO.Pdf.PdfDocumentEventArgs e) { EO.Pdf.HtmlToPdfResult result = MVCToPDF.Result;
//Uncomment the following line to save the result //to a file result?.PdfDocument.Save(@"C:\Temp\TestFile.pdf"); }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, Your code looks fine. Can you try to create a test project and send the test project to us so that we can debug it here? See here for more details: https://www.essentialobjects.com/forum/test_project.aspxThanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/19/2018 Posts: 7
|
Thanks, I sent that in this morning.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
This is just to let you know that we are able to reproduce the problem and are currently trying to find a solution. We will reply here again as soon as we have an update.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 9/19/2018 Posts: 7
|
I just wanted to see if you had an update on this, or if you have another product I could purchase that would work in this environment please let me know. I have an October 5th deadline I'm trying to meet.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
We are working on this but I do not believe it would be production ready by October 5th. We might have a test build by then, but in order to run through all the test end of October would be more realistic. For now the only way to make it work is to use the regular ASP.NET MVC, not the NET Core MVC, sorry about it!
We will rely here again as soon as we have an update on this issue.
|
|
Rank: Newbie Groups: Member
Joined: 9/19/2018 Posts: 7
|
Would it be ready for Alpha testing (meaning we could test it in our internal environment)? Our code freeze is October 5th, but we only have demos at that point and won't be shipping until end of November / December.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Certainly. Right now we don't have anything yet, we will keep you updated.
|
|
Rank: Newbie Groups: Member
Joined: 9/19/2018 Posts: 7
|
Thanks. Please let me know when you have an ETA where we'd be able to test internally.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
We have posted a test build. Please see your private message for the download location.
Thanks!
|
|