Welcome Guest Search | Active Topics | Sign In | Register

NullReferenceException in MVC Core Application Options
Scott
Posted: Wednesday, September 19, 2018 2:31:39 PM
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");
}
eo_support
Posted: Wednesday, September 19, 2018 2:43:00 PM
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.aspx

Thanks!
Scott
Posted: Thursday, September 20, 2018 10:14:36 AM
Rank: Newbie
Groups: Member

Joined: 9/19/2018
Posts: 7
Thanks, I sent that in this morning.
eo_support
Posted: Friday, September 21, 2018 11:06:34 AM
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!
Scott
Posted: Monday, September 24, 2018 12:45:31 PM
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.
eo_support
Posted: Monday, September 24, 2018 10:23:59 PM
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.
Scott
Posted: Tuesday, September 25, 2018 8:29:17 AM
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.
eo_support
Posted: Tuesday, September 25, 2018 9:31:50 AM
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.
Scott
Posted: Tuesday, September 25, 2018 9:36:14 AM
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.
eo_support
Posted: Tuesday, October 2, 2018 9:56:31 AM
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!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.