I have reviewed your DEMO file and made some adjustments to the function call method, however, the result is the same.
I also tried to use the old SPIRE doc version 5.7.0.54040 and spire pdf 3.7.291.54040 with the new license provided, but it didn't work either - I am getting
2020-10-19 15_12_26-spire doc.pdf.png
error on the 3rd page.
The Spire.Doc assemblies are referenced in the class library project which is later deployed to MS Dynamics CRM server as a plugin (.dll file).
2020-10-19 15_13_27-spire doc 2.png
What I have also noticed is that the
old version of the Spire.Doc works okay as a free version when deployed to the MS Dynamics CRM plugin database, but the newer version of your doesn't. I get the message that the Spire.Doc DLL failed to load because
it doesn't exist on the server. I have also tried to merge the assemblies into 1 using ILMerge, but that also did not work because the Spire.License DLL fails to be merged due to duplicate references in it (and as I understand it is not allowed to do so, but I wanted to try it as a workaround for this problem).
- Code: Select all
try
{
//Spire.License.LicenseProvider.SetLicenseFileName("license.elic.xml");
MemoryStream stream = GetStream(note["documentbody"].ToString());
Spire.License.LicenseProvider.SetLicenseKey(licensekey); //license key string contains the license key from the XML file. The string is declared in the class as a global string);
Spire.Doc.Document document = new Spire.Doc.Document();
document.LoadFromStream(stream, Spire.Doc.FileFormat.Docx);
stream.Close();
//Convert Word to PDF
MemoryStream pdfStream = new MemoryStream();
document.SaveToStream(pdfStrea, Spire.Doc.FileFormat.PDF);
string pdfBase64 = GetBase64FromStream(pdfStream);
pdfStream.Close();
document.Close();
string convertedPDFFileName = GetPDFName(service, target, preImage);
Login to view the files attached to this post.