Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed May 08, 2013 11:38 am

Hi, I recetly installed the latest Spire Office in preparation for one of customers buying the product. I get a nerror message while saving a file, this previously worked but now doesn't? the error is

Spire.Pdf.PdfNewDocument.ᜈ()

It happens on this line of code:

Code: Select all
document.SaveToFile(sOutput, FileFormat.PDF);


Thanks,
Derek.

derek
 
Posts: 42
Joined: Mon Nov 19, 2012 11:55 am

Thu May 09, 2013 3:36 am

Dear derek,

Thanks for your inquiry.
I tested the latest Spire Office, but didn't reproduce this error.
Please provide us your complete code and test document to help us reproduce your issue.

Thanks and Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Thu May 09, 2013 10:14 am

Hi I have attached the doc and code thanks!

Code: Select all
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;
        }

derek
 
Posts: 42
Joined: Mon Nov 19, 2012 11:55 am

Fri May 10, 2013 6:37 am

Dear Derek,

Thanks for your reply.
I used separately Spire.Office Version:2.5 and Spire.Office Version:2.5.7 to test your code and doc file, but didn't still reproduce this issue. Would you please tell us the version of dlls you used?

Thanks and Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Fri May 10, 2013 4:06 pm

Hi I got this warning:
Warning 1 Found conflicts between different versions of the same dependent assembly. clsSpireLib

derek
 
Posts: 42
Joined: Mon Nov 19, 2012 11:55 am

Fri May 10, 2013 4:27 pm

Actually I just fixed it by removing the reference in the app config?

Code: Select all
   <!--<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>-->

derek
 
Posts: 42
Joined: Mon Nov 19, 2012 11:55 am

Mon May 13, 2013 2:38 am

Dear Derek,

Thanks for your sharing.
We are happy to hear that your issue has been solved.

BTW, has this issue(http://www.e-iceblue.com/forum/viewtopic.php?f=4&t=3868) you posted in other forum been solved?
Please give us a feedback message on this issue.

There is any issue, please feel free to contact us.

Thanks and Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc