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.

Sat Dec 27, 2014 11:13 pm

Hi,

I am working through an issue with using Spire.Doc and using it inside a .NET Web API.

I have successfully written code that uses Spire.Doc in a Windows Form application for testing purposes that takes a Word document does a MailMerge and some other processing and generates a PDF document.

My real intention is to take the code and re-use it inside a .NET Web Api - basically call a REST endpoint that returns a PDF file. I'm finding however that the mail merge is not working (fields are empty) on the generated document when called from inside the web api processing. This is all happening on my local machine at the moment when debugging inside Visual Studio.

Looking in the forums here it looks like there may be some limitations around where Spire.Doc can be run in a web environment (e.g. GDI/GDI+ requirement post12653.html?hilit=azure#p12653) and I'm wondering whether I might be running into some known issues here.

In production, I want to host this service in Azure or AWS. Is this possible and if so are there any examples or best practices I should know about?

I'm continuing to investigate my issues but wanted to know if I was hitting something obvious.

Thanks,
Joe

jnalewabau
 
Posts: 8
Joined: Mon Oct 06, 2014 6:24 am

Mon Dec 29, 2014 7:28 am

Dear jnalewabau,

Sorry for the delay reply.

1) About .NET Web API
You mentioned that the mail merge was not working on the generated document. Can you send us your code snippet and sample document to help us reproduce this problem?

2) Azure or AWS
As GDI and GDI+ are not supported well Azure or AWS, there may be some limitations about Spire.Doc, for example, convert doc to pdf is not supported.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Sat Jan 03, 2015 6:06 am

Just a quick note that I found the problem. The source document I was getting had slightly different field names which meant that the MailMerge wasn't matching them.

jnalewabau
 
Posts: 8
Joined: Mon Oct 06, 2014 6:24 am

Mon Jan 05, 2015 1:10 am

Dear jnalewabau,

Sorry for the delay reply.

I'm glad to hear that you found the reasons of this problem. When do mail merge, the field names in the document and the code snippet should be the same, otherwise, the mail merge would fail.

Please feel free to contact us if you have any problems.
Best Regards,
Burning
E-iceblue Support Team
User avatar

burning.liu
 
Posts: 406
Joined: Mon Aug 04, 2014 6:47 am

Thu Sep 28, 2017 9:57 am

Hi,

Thanks for patient waiting.
Now the issue converting Word to PDF (GDI + error) on Azure has been fixed. Please use the latest Spire.Doc Pack(hot fix) Version:6.0.8 and the PS method to have a try.
Code: Select all
              Document doc = new Document();
              doc.LoadFromFile(filename);
              ToPdfParameterList tpl = new ToPdfParameterList
                    {
                        UsePSCoversion = true                         
                    };
               doc.SaveToFile(resultname, tpl);

If you have any issue, please feel free to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Wed Dec 13, 2017 6:58 am

Hi,

Is there a fix for the free edition.
(the current free version 5,7 don't contains the UsePSConvertion option for the PDF param list)

I'm working on a very small project hosted on Azure that only need to convert a 2 page document, so I don't need the full version.

webmixer@gmail.com
 
Posts: 1
Joined: Sat Nov 25, 2017 8:04 pm

Wed Dec 13, 2017 7:25 am

Hello,

Thanks for your inquiry.
I am sorry we have no plan to upgrade the free version at present. You need to use the full version to accomplish your task.

Sincerely,
Simon
E-iceblue support team
User avatar

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

Return to Spire.Doc