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.

Fri Dec 22, 2017 3:55 pm

Dear, I have the following problem. In the company bought 2 licenses, one that is for a server and a developer and another multi-server and a developer, with the first I have no problem but the second the multi-server I can not develop in the server machine I get the watermark that it is only a trial version, please help in order to better configure the licenses in my source, should they be in a fixed route in the development machine? in the source should it contain or embed?
the other problem is with the MailMerge, I have my datable and I go through it in a datarow and when executing the "Execute" there is a considerable delay in the Merge, besides that when creating the file it takes much longer, I have a process time of 3,000 documents in a time of 10 hours and that is not acceptable for a daily process, for reference the larger document has a maximum of 18 pages, and I save the document in PDF.

jirs_tok
 
Posts: 7
Joined: Thu Oct 12, 2017 1:36 am

Mon Dec 25, 2017 2:29 am

Hello,

Thanks for your post.
For the first problem, please apply the license by key and try again. On the other hand, please make sure the license is not expired.
https://www.e-iceblue.com/Tutorials/Lic ... ply_by_Key
For the second one, to help us investigate further, please share us with several documents which take much time on your side and the code you were using.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Dec 26, 2017 12:24 pm

my source.

Code: Select all
        private void GeneraPdfWeb(string FECHAINI, string FECHAFIN, string POLIZA, string NEGOCIO_ID, string CORREDOR_ID
                                        , string CORREDOR_RUT, string TIPO_FORMATO_ID, string FORMATO_RUTA, string Corredora_Nom)
        {
            //genero datatable para realizar los certificados OJO agregar query al SP
            string str = @"EXEC AFF_CERT_GET_DATACERT " +
                        POLIZA + "," +
                        "'" + FECHAINI + "'" + "," +
                        "'" + FECHAFIN + "'" + "," +
                        TIPO_FORMATO_ID;
            sqlconn.Open();
            SqlDataAdapter da = new SqlDataAdapter(str, sqlconn);
            DataTable dt = new DataTable();
            dt.TableName = "cert";
            da.Fill(dt);
            sqlconn.Close();

            string Fec_A = FECHAINI.Substring(0, 4);
            string Fec_M = FECHAINI.Substring(4, 2);
            string Fec_D = FECHAINI.Substring(6, 2);

            StrDirectorioFORMATOS = "" + FORMATO_RUTA + "";
            StrDirectorioWeb = @"\\10.140.132.98\Cartas_y_Certificados\" + Corredora_Nom + @"\CERTIFICADOS\" + Fec_D + Fec_M + Fec_A + @"\" + POLIZA + @"\";
            StrDirectorioWebCifrados = @"\\10.140.132.98\Cartas_y_Certificados\" + Corredora_Nom + @"\CERTIFICADOS\" + Fec_D + Fec_M + Fec_A + @"\" + POLIZA + @"\Cifrados\";

            if (!Directory.Exists(StrDirectorioWeb))
                Directory.CreateDirectory(StrDirectorioWeb);
            if (!Directory.Exists(StrDirectorioWebCifrados))
                Directory.CreateDirectory(StrDirectorioWebCifrados);

            int dt_count = dt.Rows.Count;

            if (dt_count != 0)
            {
                try
                {

                    foreach (DataRow row in dt.Rows)
                    {
                        Document certificados = new Document();
                        ToPdfParameterList certPdfEncrypt = new ToPdfParameterList();
                        certificados.LoadFromFile(StrDirectorioFORMATOS);

                        certificados.MailMerge.ClearFields = true;
                        certificados.MailMerge.Execute(row);
                        certificados.SaveToFile(StrDirectorioWeb + row["NOMBRE_DOC"].ToString() + ".pdf", Spire.Doc.FileFormat.PDF);
                        certificados.Dispose();

                        if (CORREDOR_ID == "77191070")
                        {
                            string encript = pass(row["RUT"].ToString());
                            certPdfEncrypt.PdfSecurity.UserPassword = encript;
                            certificados.SaveToFile(StrDirectorioWebCifrados + row["NOMBRE_DOC"].ToString() + ".pdf", certPdfEncrypt);
                            certificados.Dispose();
                        }

                        certificados.Close();
                    }
                }
                catch (Exception e)
                {
                    Dts.Events.FireError(0, "GENERA PDF WEB", e.Message + e.StackTrace, string.Empty, 0);
                    Dts.TaskResult = (int)ScriptResults.Failure;
                }
            }
            else
            {
                string path = StrDirectorioWeb + @"\" + POLIZA + "_" + FECHAINI + "_Sin_Datos.txt";
                FileStream fs = File.Create(path);
                Byte[] info = new UTF8Encoding(true).GetBytes("No Existen Datos");
                fs.Write(info, 0, info.Length);
                fs.Close();                               
            }


        }

jirs_tok
 
Posts: 7
Joined: Thu Oct 12, 2017 1:36 am

Wed Dec 27, 2017 8:24 am

Hello,

Thanks for your sharing. Please note that if there is more data while executing the mail merge, Spire.Doc will take more time to calculate. As for the conversion, we suggest you to use PS Conversion which is much faster, you need to set certPdfEncrypt.UsePSCoversion = true before converting. Please refer to the below code snippet.
Code: Select all
            Document certificados = new Document();
            ToPdfParameterList certPdfEncrypt = new ToPdfParameterList();
            certPdfEncrypt.UsePSCoversion = true;
            certificados.LoadFromFile(StrDirectorioFORMATOS);

            certificados.MailMerge.ClearFields = true;
            certificados.MailMerge.Execute(row);
            certificados.SaveToFile(StrDirectorioWeb + row["NOMBRE_DOC"].ToString() + ".pdf", certPdfEncrypt);
            certificados.Dispose();


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Dec 27, 2017 4:14 pm

finally, the problem is in this line of code the delay occurs when the attempt saves the PDF is too long to delay for a document of 18 sheets, which is already executed the "MergeMail", any solution?

Code: Select all
certificados.SaveToFile(rutaComWeb, Spire.Doc.FileFormat.PDF);

jirs_tok
 
Posts: 7
Joined: Thu Oct 12, 2017 1:36 am

Thu Dec 28, 2017 2:55 am

Hello,

Thanks for your feedback. Please try the below solution which is using the PS Conversion to convert Word to PDF.
Code: Select all
            Document certificados = new Document();
            certificados.LoadFromFile(fileName);
            ToPdfParameterList ps = new ToPdfParameterList();
            ps.UsePSCoversion = true;
            certificados.SaveToFile("result.pdf", ps);
            certificados.Dispose();


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Thu Dec 28, 2017 2:35 pm

I tried, but loses the format of the word template. Something that keeps the format and is fast when saving in .PDF. I do not want to think that spire was a bad investment.

jirs_tok
 
Posts: 7
Joined: Thu Oct 12, 2017 1:36 am

Fri Dec 29, 2017 1:35 am

Hello,

Thanks for your feedback. Would you please share us with the document of 18 pages and how much time does it takes while converting?

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Dec 29, 2017 8:45 am

Hello,

Greeting from E-iceblue.
How is the issue going?
We will appreciate it if you could give us some feedback.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Dec 29, 2017 3:02 pm

I think it is somewhat complicated to send the document as they are legal paper with very sensitive information, so far in the server where the ETL runs it takes about 4 hours the creation of 1500 documents, thinking that the server is virtual and not physical , but in production the server would be physical and there should earn some more time. for the moment I am satisfied with those times since it is a nocturnal process but when the demand is bigger I worry a bit. otherwise improve the doc.dll for when you save in pdf do not delay so much would be excellent.

jirs_tok
 
Posts: 7
Joined: Thu Oct 12, 2017 1:36 am

Mon Jan 01, 2018 3:03 am

Hello,

Thanks for your response. Strictly speaking, the performance of the program is affected by many factors, not only our product but also the environment, and so on, so when the demond is bigger, you could also need to consider improving your device, anyway, we are always trying to improve the performance of our product,and now the PS conversion method that was provided by Simon is faster than the normal one.

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Feb 20, 2018 3:09 pm

estimates, improvement in PDF creation times?

Greetings.

jirs_tok
 
Posts: 7
Joined: Thu Oct 12, 2017 1:36 am

Wed Feb 21, 2018 3:18 am

Hello,

Thank you for following up.
Sorry, at the moment we can't provide you the ETA due to complexity of the issue.
Please use PS conversion method at present.

Sincerely,
Amy
E-iceblue support team
User avatar

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

Return to Spire.Doc

cron