We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Issue Applying License To Generate PDF - using ASPOSE WORDS

Hi ,
I am converting HTML data to PDF format using ASPOSE WORDS.
I am using license copy of ASPOSE for this.
But sometimes while generating the PDF file , the license don’t get applied to the generated PDF file.
And I get a red Header on PDF doc, suggesting that I am using it in evaluation mode, which i snot the case.
Below given is my code that I am using.

private MemoryStream GenerateFileStreamData(string MyDir, Stream stream, string strFileName)
MemoryStream Ms = new MemoryStream();
License lic = new License();
catch (Exception ex)
string str = “License Exception:” + ex.Message.ToString();
LoadOptions loadOptions = new LoadOptions();
loadOptions.BaseUri = MyDir;
Document doc = new Document(stream, loadOptions);
DocumentBuilder docBuilder = new DocumentBuilder();
docBuilder.Document = doc;
PageSetup ps = docBuilder.PageSetup;
ps.RightMargin = 5;
ps.LeftMargin = 10;
doc.Save(Ms, Aspose.Words.SaveFormat.Pdf);
if (Ms != null)
Ms.Position = 0;
catch (Exception ex)
//strRes = “Exception:” + ex.Message.ToString() + " Stack Trace:" + ex.StackTrace.ToString();
throw ex;
return Ms;

I am getting the following error message:-

Please find the attached image for the error message.

Error Message : The invoked member is not supported in a dynamic assembly.

Stack Trace:
at System.Reflection.Emit.InternalAssemblyBuilder.GetManifestResourceNames() at x28925c9b27b37a46.x220f433da4115056.x0004f58017c756bc(Assembly xd3764619ec304ff0, String xf3a1146bd8778bac) at x28925c9b27b37a46.x220f433da4115056.xde6236852622c268(String x1c1fc72fe1a3b4ea, Assembly x39e0a96279c40baa) at x28925c9b27b37a46.x220f433da4115056.x7d0214bf69711dd9(String x1c1fc72fe1a3b4ea, Assembly x5807f920b6fc67c4) at Aspose.Words.License.SetLicense(String licenseName) at CreditSummaryHistory.Controllers.SummaryController.GenerateFileStreamData(String MyDir, Stream stream, String strFileName) in c:\Users\3rd\Source\Workspaces\WebApi\Api.CreditSummaryHistory\Controllers\SummaryController.cs:line 210

Please let me know if I missed out on anything.

Hi Vishal,

Thanks for your inquiry. It would be great if you please create a standalone runnable console application that helps us reproduce your problem on our end and attach it here for testing. As soon as you get this simple application ready, we’ll start further investigation into your issue and provide you more information.

Best regards,