Rank: Newbie Groups: Member
Joined: 4/2/2014 Posts: 4
|
Hi, I am trying to silently save the pdf on the server on button click but get the following error at " ASPXToPDF1.RenderAsPDF(false);" while debugging:
"Value cannot be null. Parameter name: type "
It generates pdf on the client successfully but when I try to save it silently, it gives error mentioned above.
Following is my code snippet:
protected void btnSubmit_Click(object sender, EventArgs e) { EO.Pdf.Runtime.AddLicense("****"); EO.Pdf.HtmlToPdf.Options.PageSize = new System.Drawing.SizeF(11F, 8.5F);// landscape EO.Pdf.HtmlToPdf.Options.OutputArea = new System.Drawing.RectangleF(0.5f, 0.5f, 10f, 10f); // margins EO.Pdf.HtmlToPdf.Options.MinLoadWaitTime = 5000; ASPXToPDF1.RenderAsPDF(false); //Cast the Result property to HtmlToPdfResult HtmlToPdfResult result = (HtmlToPdfResult)ASPXToPDF1.Result; //Save the conversion result to a file result.PdfDocument.Save(Server.MapPath("test.pdf")); }
Please help. Thanks.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
This is because your version of EO.Web.dll and EO.Pdf.dll are incompatible. You can try to get both DLLs from the same installation and that should solve the problem for you.
Thanks!
|