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)
Login to view the files attached to this post.