Spire.Doc Professional - Save PDF

Technical support for Spire.Doc

Moderator: iceblue support

Re: Spire.Doc Professional - Save PDF

Postby amy.zhao » Tue Nov 13, 2012 9:01 am

Hi,

Thanks for you waiting.
We have fixed your problem, please download Spire.Doc Pack (Hot Fix) Version:4.5.12 from the link http://www.e-iceblue.com/Download/download-word-for-net-now.html.
If you have any problem, please feel free to contact us.

Best regards,
Amy
E-iceblue support
User avatar
amy.zhao
 
Posts: 2229
Joined: Wed Jun 27, 2012 8:50 am

Re: Spire.Doc Professional - Save PDF

Postby emailregistrazioni » Fri Nov 16, 2012 3:09 pm

Hi,
you have not solved the problem. When I try to export to PDF, it gives error "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" here:

Code: Select all
document.SaveToFile(codice_offerta.Replace("/", "_") + ".pdf", FileFormat.PDF, Response, HttpContentType.Attachment);

For example, the variable 'codice_offerta' is "2012/00003/v.8" .

The same command but with the extension .doc works perfectly:
Code: Select all
document.SaveToFile(codice_offerta.Replace("/", "_") + ".doc", FileFormat.Doc, Response, HttpContentType.Attachment);


In general it has always worked well with the PDF with the previous versions. Only the last two hotfix gives this problem (spire.doc_hotfix_4.4.30, spire.doc_hotfix_4.5.12). Unfortunately, I have the impression that in order to correct the previous error replace a mail field you have something else wrong.

I've done other tests, so as to help you find the error (Removing the email address and replace leaving everything fixed in the base document):

TEST1
I set the basic document in the footer fixed an email address like this:

".... E-mail: ordini@test.it - website: www.test.it"

In the DOC file remains the same, while the PDF is changed to:

".... E-mail: - website: www.test.it"

and the word email containing the link "mailto: ordini@test.it"

TEST2
In the basic document i removed the link from the email like this:

".... E-mail: ordini@test.it - website: www.test.it"

In the DOC file remains the same, while the PDF is changed to:

"....E-mail: ordini@test.it - website: "

and the word website containing the link "www.test.it"

TEST3
In the basic document i removed the link from the websitelike this:

".... E-mail: ordini@test.it - website: www.test.it"

When I try to export to PDF, it gives the same mistake of the last two hotfixes! "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index" here:

Code: Select all
document.SaveToFile(codice_offerta.Replace("/", "_") + ".pdf", FileFormat.PDF, Response, HttpContentType.Attachment);

For example, the variable 'codice_offerta' is "2012/00003/v.8" .

Also noticed another error always in the PDF: If you upload a picture and there is not enough space for the page is finished, the image is cropped. While rightly in .doc if there is no space moves all on the next page (see attachment)

PS= Please do not delete my post (as you did with the previous post)
You do not have the required permissions to view the files attached to this post.
emailregistrazioni
 
Posts: 11
Joined: Sun Sep 18, 2011 9:32 pm

Re: Spire.Doc Professional - Save PDF

Postby harry.support » Mon Nov 19, 2012 10:21 am

Hi Pippo Pluto,

Thank you so much for these tests which you did.
For your test #1 ~ #3, we have done some test too, with the same hotfix. But we did not reproduce these problems posted by you. I think we did get clearly what you have done. We post our simple test code, and would you please send us your test code and word document.
Our code:
Code: Select all
using System;
using System.Collections.Generic;
using System.Text;

using Spire.Doc;

namespace SALESSUPPORT_935
{
    class Program
    {
        static void Main(string[] args)
        {
            Document doc1 = new Document();
            doc1.LoadFromFile(@"..\..\document1.doc");
            doc1.Replace("ISIS8#", "ordini@test.it", true, false);
            doc1.SaveToFile("test1.pdf", FileFormat.PDF);
            System.Diagnostics.Process.Start("test1.pdf");

            Document doc2 = new Document();
            doc2.LoadFromFile(@"..\..\document2.doc");
            doc2.SaveToFile("test2.pdf", FileFormat.PDF);
            System.Diagnostics.Process.Start("test2.pdf");

            Document doc3 = new Document();
            doc3.LoadFromFile(@"..\..\document3.doc");
            doc3.Replace("ISIS8#", "ordini@test.it", true, false);
            doc3.SaveToFile("test3.pdf", FileFormat.PDF);
            System.Diagnostics.Process.Start("test3.pdf");
        }
    }
}

And for the #4, we did the same test, and not got the same error as you.
You do not have the required permissions to view the files attached to this post.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Spire.Doc Professional - Save PDF

Postby info@isis.it » Fri Nov 30, 2012 10:03 am

Hi,
I run your test project and I got the same error (see attached pdf 1 and 2, pdf 3 does not create it because it is in error).

I am attaching again my word document..


This is my code:

Code: Select all

.....

//Create word document
Document document = new Document();

string appPath = HttpContext.Current.Request.ApplicationPath;
string physicalPath = HttpContext.Current.Request.MapPath(appPath);
document.LoadFromFile(physicalPath + @"\Termoacqua_base.doc");

.....

if ((agente.email != "") && (agente.email != null))
     document.Replace("ISIS8#", agente.email, false, false);
else
     document.Replace("ISIS8#", "", false, false);




As for the pictures cut can not have reproduced the same error, but you could see from the screenshot that there is! This is a big problem, you can not fix it?

Thanks
You do not have the required permissions to view the files attached to this post.
info@isis.it
 
Posts: 20
Joined: Thu Sep 27, 2012 9:01 am

Re: Spire.Doc Professional - Save PDF

Postby amy.zhao » Mon Dec 03, 2012 4:53 am

Hello,

Thanks for your feedback.
We are sorry for the delay response for the weekends here.
We do some tests according to your code again, but we still don't reproduce your problem. We attach our test code and result pdf files.
Code: Select all
            Document doc1 = new Document();
            doc1.LoadFromFile(@"..\..\documents\Termoacqua_base.doc");
            doc1.Replace("ISIS8#", "", false, false);
            doc1.SaveToFile(@"..\..\documents\test1.pdf", FileFormat.PDF);

            Document doc2 = new Document();
            doc2.LoadFromFile(@"..\..\documents\Termoacqua_base.doc");
            doc2.Replace("ISIS8#", "amy.zhao@e-iceblue.com", false, false);
            doc2.SaveToFile(@"..\..\documents\test2.pdf", FileFormat.PDF);


For test #2 and test #3, we don't know which method you use to remove the links from the email and the website. We list two methods, please tell us you use method#1 or method#2. If you use others methods, please tell us.
1. use Word to open doc file, and then remove directly the links in doc file.
2. use Spire.doc to load doc file, and then remove the links in code.

For the problem about pictures to be cut, could you please provide us your sample doc file which can reproduce the problem? So that we can quickly reproduce the problem, and work out a solution for you. If this is a bug of Spire.doc, we will fix the bug soon. Thank you!

Best regards,
Amy
E-iceblue support
You do not have the required permissions to view the files attached to this post.
User avatar
amy.zhao
 
Posts: 2229
Joined: Wed Jun 27, 2012 8:50 am

Re: Spire.Doc Professional - Save PDF

Postby info@isis.it » Wed Dec 05, 2012 11:14 am

Hi,
i followed your instructions but I still have the same problems. I should note that I have always removed the link from Word.
Here are my tests:

TEST1
In "Termoacqua_base.doc" i removed the links from the "ISIS8#" and "www.termoacqua.com":

".... E-mail: ISIS8# - website: www.termoacqua.com"

In the DOC file everything is ok, but when I try to export to PDF, it gives the error "Object reference not set to an instance of an object." here:

Code: Select all
document.SaveToFile(codice_offerta.Replace("/", "_") + ".pdf", FileFormat.PDF, Response, HttpContentType.Attachment);


For the word is the same code, just change FileFormat.Doc and should not be mistaken.

TEST2
In "Termoacqua_base.doc" i removed the link from the "ISIS8#" like this:

".... E-mail: ISIS8# - website: www.termoacqua.com"

In the DOC file everything is ok, but in PDF is changed to:

"....E-mail: ordini@test.it - website: "

and the word website containing the link "www.termoacqua.com"

TEST3
In "Termoacqua_base.doc" i removed the link from the "www.termoacqua.com" like this:

".... E-mail: ISIS8#" - website: www.termoacqua.com

In the DOC file everything is ok, but when I try to export to PDF, it gives the error "Object reference not set to an instance of an object." here:

Code: Select all
document.SaveToFile(codice_offerta.Replace("/", "_") + ".pdf", FileFormat.PDF, Response, HttpContentType.Attachment);


For the word is the same code, just change FileFormat.Doc and should not be mistaken.

--------------
For the problem about pictures to be cut, i have attached an example, as usual, the DOC is perfect while the PDF is not good. (Because of the limit on the size of the file to attach I could not upload the DOC. I then manually created a PDF from DOC. The result is the same).

I also noticed, only in PDF, which are pasted some data in the header
""Pasqualino Raso p.raso@isis.it 3483182961""

I hope you can solve everything as soon as possible. Thank you
You do not have the required permissions to view the files attached to this post.
info@isis.it
 
Posts: 20
Joined: Thu Sep 27, 2012 9:01 am

Re: Spire.Doc Professional - Save PDF

Postby harry.support » Thu Dec 06, 2012 4:22 am

Hi,

We understand that these problems are important and urgent and we always want to fix them quickly. But we can't reproduce your problem. We have read your posts and viewed your attachments many times, we found that we maybe used different methods forms yours. In your post Nov 30, 2012, you provided use different code from our demo, and the pdf files attached were not directly converted from the doc file attached. And in your last post, the attached pdf were converted from other documents.
For reproducing your problems, at first, we should make sure that we run the same code to load the some word documents with the same dll files. Would your please:
1. Run directly the full project attached (it is too large, we send it by mail to info@isis.it) without any changes. We attached the result pdf files. If it reproduces your problem #1, #2 and #3, please send us your result pdf files. If it could not reproduce your problem, please send us a full project which we can run directly without any changes to reproduce your problem #1, #2 and #3. If your project is too large, please send it to support@e-iceblue.com
2. Send us the document which we can convert directly to reproduce your problem #4. The "convert directly" means we use the code:
Code: Select all
Document doc4 = new Document();
doc4.LoadFromFile(@"document4.doc");
doc4.SaveToFile("test4.pdf", FileFormat.PDF);

After reproducing your problems, we will try our best to fix them as soon as possible.

Thanks and Regards,
You do not have the required permissions to view the files attached to this post.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Spire.Doc Professional - Save PDF

Postby info@isis.it » Mon Dec 10, 2012 11:09 am

Hi,
I did the test with your project and everything works. I attach the files.

In the meantime, I sent our source code at support@e-iceblue.com.

Thanks
You do not have the required permissions to view the files attached to this post.
info@isis.it
 
Posts: 20
Joined: Thu Sep 27, 2012 9:01 am

Re: Spire.Doc Professional - Save PDF

Postby amy.zhao » Tue Dec 11, 2012 9:39 am

Hi,

Thanks for your feedback.
We have received your code and documents you sent to support@e-iceblue.com. We find that the version of spire.doc you used is spire.doc_4.4.30. In my previous post, I had informed you that Spire.Doc Pack Version:4.5 and Spire.Doc Pack(hotfix) Version:4.5.12 fixed the problem about email and website in the footer in document.doc file you provided us on Thu Sep 27, 2012. We have used Spire.Doc Pack(hotfix) Version:4.5.12 and Spire.Doc Pack (Hot Fix) Version:4.5.25 to test test1,test2, test3. They work well on our side. Please use Spire.Doc Pack (Hot Fix) Version:4.5.25(the download link is http://www.e-iceblue.com/Download/download-word-for-net-now.html)to test test1,test2, test3 again. If you still encounter the problems when you use Spire.Doc Pack (Hot Fix) Version:4.5.25, please don't hesitate to tell us.

For the file 2012_00003_v.8.doc, we use Spire.Doc Pack (Hot Fix) Version:4.5.25 to do some tests. We don't reproduce the problem about pictures to be cut, but we find the problems that the link address after website in footer disappear and the border of some tables disappear in the generated pdf file. We have posted the problems to our dev team. Also could you please tell us which tool you use to generate the file 2012_00003_v.8.doc? Was it created by our spire.doc component? If it is, please tell us the version of spire.doc you used. Your help will help us to resolve the problems soon.Thank you!

Best regards,
Amy
E-iceblue support team
User avatar
amy.zhao
 
Posts: 2229
Joined: Wed Jun 27, 2012 8:50 am

Re: Spire.Doc Professional - Save PDF

Postby amy.zhao » Wed Dec 12, 2012 9:12 am

Hi,

Did you use Spire.Doc Pack (Hot Fix) Version:4.5.25 to test Termoacqua_base.doc and 2012_00003_v.8.doc? Could you please tell us your test results? Did the hotfix fix all problems with Termoacqua_base.doc and the problem about pictures to be cut with 2012_00003_v.8.doc? Thank you!

Best regards,
Amy
E-iceblue support team
User avatar
amy.zhao
 
Posts: 2229
Joined: Wed Jun 27, 2012 8:50 am

Re: Spire.Doc Professional - Save PDF

Postby info@isis.it » Fri Dec 14, 2012 3:30 pm

Hi,
I installed Spire.Doc Pack (Hot Fix) Version: 4.5.25.

I confirm that the problem of the email and the website has been fixed, and perhaps also the problem of pictures cut.
I can not be more precise because something strange happens (especially with PDF). For the same document, and randomly when I launch the export four things happen:
- all is well

- all is wel , but the browser instead of asking whether to open or save the file, it automatically opens in browser and the file name is the same as the aspx page, instead of the name I wanted
Code: Select all
document.SaveToFile(codice_offerta.Replace("/", "_") + ".pdf", FileFormat.PDF, Response, HttpContentType.Attachment);

- error "Object reference not set to an instance of an object" (attached "error")
- error "ArgumentOutOfRangeException was unhandled by user code - Index was out of range. Must be non-negative and less than the size of the collection." (attached "error2")


Also could you please tell us which tool you use to generate the file 2012_00003_v.8.doc?


I use your library to generate doc and pdf files (I sent you the source code in the previous post / email).

Thanks
You do not have the required permissions to view the files attached to this post.
info@isis.it
 
Posts: 20
Joined: Thu Sep 27, 2012 9:01 am

Re: Spire.Doc Professional - Save PDF

Postby info@isis.it » Fri Dec 14, 2012 6:15 pm

Hi,
about this issue previously reported: "all is wel , but the browser instead of asking whether to open or save the file, it automatically opens in browser and the file name is the same as the aspx page, instead of the name I wanted" attached another strange thing happens with the new hotfix.

Thanks
You do not have the required permissions to view the files attached to this post.
info@isis.it
 
Posts: 20
Joined: Thu Sep 27, 2012 9:01 am

Re: Spire.Doc Professional - Save PDF

Postby info@isis.it » Fri Dec 14, 2012 6:49 pm

Hi,
about this issue previously reported: " error "Object reference not set to an instance of an object" (attached "error") " i think I understand what conflicts: with this source code is in error

Code: Select all
Paragraph p_prod_foto_desc2 = dataRow_prod_foto_desc.Cells[1].AddParagraph();
p_prod_foto_desc2.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Left;
string desc = Formatta(cond_da_formattare);
p_prod_foto_desc2.AppendHTML(desc);


but if I do that it works

Code: Select all
Paragraph p_prod_foto_desc2 = dataRow_prod_foto_desc.Cells[1].AddParagraph();
p_prod_foto_desc2.Format.HorizontalAlignment = Spire.Doc.Documents.HorizontalAlignment.Left;
p_prod_foto_desc2.AppendHTML(cond_da_formattare);


Must be the function Formatta (even if I do not have an explanation). The strange thing is that it does even when the variables 'desc' and 'cond_da_formattare' are the same!

Code: Select all
private static string Formatta(string testo)
        {
            if (testo.Length > 0)
            {
                if (testo.Substring(0, 1) != "<")
                {
                    testo = string.Concat("<div>", testo, "</div>");
                }

                testo = testo.Replace("<div>", "<div style='font-family:Arial;font-size:13.5px;color:#404040'>");
                testo = testo.Replace("<p>", "<p style='font-family:Arial;font-size:13.5px;color:#404040'>");
                testo = testo.Replace("<ul>", "<ul style='font-family:Arial;font-size:13.5px;color:#404040'>");
                testo = testo.Replace("<ol>", "<ol style='font-family:Arial;font-size:13.5px;color:#404040'>");
                testo = testo.Replace("<li>", "<li style='font-family:Arial;font-size:13.5px;color:#404040'>");
            }
            return testo;
        }
info@isis.it
 
Posts: 20
Joined: Thu Sep 27, 2012 9:01 am

Re: Spire.Doc Professional - Save PDF

Postby harry.support » Mon Dec 17, 2012 10:26 am

Hi,
Sorry for the inconvenience cuased by us.
As your description and your attachment, your problems occur randomly. They are might caused by the error of releasing of resource in web application. Our dev team are analyzing your problems and we will try to fix them soon. If we have any progress or we need more information, we will tell you immediately.

Best Regards.
Harry
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Spire.Doc Professional - Save PDF

Postby amy.zhao » Tue Dec 18, 2012 7:55 am

Hello,

We have reproduced the error "Object reference not set to an instance of an object". Our dev team are trying to fix it. But we don't reproduce other errors. Could you please provide us your complete project which we can directly run on our side? The dlls can remove from the project, and you only need to tell us the versions of the dlls you used. So that we can reproduce the errors, and our dev team can find out the key cause. Thank you!

Best regards,
Amy
E-iceblue support team
User avatar
amy.zhao
 
Posts: 2229
Joined: Wed Jun 27, 2012 8:50 am

PreviousNext

Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests