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.

Mon Apr 10, 2017 9:05 pm

Hello!

I've installed a trial version of Spire.Office. I am using Spire.Xls and Spire.Doc in a web application that I have created with Visual Studio 2015. It runs fine locally, but I am getting a "Parameter is not valid" error running from our web server. The stack trace indicates that the error occurs on a call to the SaveToImages method:

at spr5315.0(PageSetup A_0, ImageType A_1, MemoryStream A_2, Int32 A_3, GraphicsUnit A_4)
at spr5315.0(PageSetup A_0, ImageType A_1, MemoryStream A_2, Int32 A_3)
at spr5315.18()
at spr5315.1(IDocument A_0)
at spr6628.0(Int32 A_0, Document A_1, ImageFormat A_2)
at Spire.Doc.Document.SaveToImages(Int32 pageIndex, ImageFormat imageFormat)
at csi_projects.courtroomsciences.com.Entrenchment.CreateEntrenchmentPage(Int64 projectID, Int64 surveyID, String reportDescription, Int32 questionNumber) in C:\Source\Web\Sites\csi-project.courtroomsciences.com\csi-projects.courtroomsciences.com\Entrenchment.aspx.cs:line 336

This is the section of code that appears to be the problem:

Spire.Doc.Document sd = new Spire.Doc.Document();
sd.Document.LoadFromFile(docPath, Spire.Doc.FileFormat.Docx);
Drawing.Image image = Drawing.Image.FromStream(sd.SaveToImages(0, Drawing.Imaging.ImageFormat.Png));

Any suggestions would be greatly appreciated!

Thanks,
Bill Logan

wslogan
 
Posts: 3
Joined: Thu Apr 06, 2017 5:37 pm

Tue Apr 11, 2017 2:21 am

Dear Bill,

Thanks for your inquiry.
It seems the issue is related to the memory on the server. Please provide us with following information for testing on our side.
1) Input files
2) Deployment environment

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Tue Apr 11, 2017 1:47 pm

Thanks for the reply, Betsy

This is a web site hosted in Azure. I am trying to save a document page as an image.

I have attached an example of a document. As I said, it works fine when I run locally.

Thanks, Bill

wslogan
 
Posts: 3
Joined: Thu Apr 06, 2017 5:37 pm

Wed Apr 12, 2017 2:56 am

Dear Bill,

Thanks for the information.
Our products support Windows Azure WebSite, but the conversion from word to image or other function based on GDI is not supported, because GDI is not well supported on Azure Shared WebSite. So sorry for this.
If there is any good way to solve this issue in the future, we will inform you.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc