Spire.Pdf.PdfNewDocument.ᜈ()
It happens on this line of code:
- Code: Select all
document.SaveToFile(sOutput, FileFormat.PDF);
Thanks,
Derek.
document.SaveToFile(sOutput, FileFormat.PDF);
public static string GetConsentFormTEST(string sStorename, string sAddress1, string sAddress2, string sAddress3, string sAddress4, string sPhoneNumber, string sFirstName, string sSurname, string sPatientAddress1, string sPatientAddress2, string sPatientAddress3, string sPatientAddress4, string sTemplate, string sOutput)
{
string[] sFieldNames = new string[12];
string[] sFieldValues = new string[12];
try
{
sFieldNames[0] = "Storename";
sFieldNames[1] = "Address1";
sFieldNames[2] = "Address2";
sFieldNames[3] = "Address3";
sFieldNames[4] = "Address4";
sFieldNames[5] = "PhoneNumber";
sFieldNames[6] = "FirstName";
sFieldNames[7] = "Surname";
sFieldNames[8] = "PatientAddress1";
sFieldNames[9] = "PatientAddress2";
sFieldNames[10] = "PatientAddress3";
sFieldNames[11] = "PatientAddress4";
sFieldValues[0] = sStorename;
sFieldValues[1] = sAddress1;
sFieldValues[2] = sAddress2;
sFieldValues[3] = sAddress3;
sFieldValues[4] = sAddress4;
sFieldValues[5] = sPhoneNumber;
sFieldValues[6] = sFirstName;
sFieldValues[7] = sSurname;
sFieldValues[8] = sPatientAddress1;
sFieldValues[9] = sPatientAddress2;
sFieldValues[10] = sPatientAddress3;
sFieldValues[11] = sPatientAddress4;
//Get template
Spire.License.LicenseProvider.ClearLicense();
Spire.License.LicenseProvider.SetLicenseFileName("license.elic.xml");
Document document = new Document(sTemplate);
document.MailMerge.Execute(sFieldNames, sFieldValues);
document.SaveToFile(sOutput, FileFormat.PDF);
//System.Diagnostics.Process.Start(sOutput);
ShowPDF(sOutput);
}
catch (Exception Ex)
{
return Ex.Message;
}
return string.Empty;
}
<!--<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Spire.Pdf" publicKeyToken="663F351905198CB3" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.7.32.7035" newVersion="2.7.32.7035"/>
</dependentAssembly>
</assemblyBinding>-->