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.

Wed Aug 22, 2018 12:28 pm

Hi,

I have a console application that should load in a *.doc file but when i do it, i get a error that Spire.Pdf could not be loaded.
i am using free spire.doc for .net 6.3(from the website).

Code: Select all
Document document = new Document();
string original = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Sjabloon.doc");
document.LoadFromFile(original , FileFormat.Doc);


The above code generates the error below:
Code: Select all
System.IO.FileNotFoundException: 'Could not load file or assembly 'Spire.Pdf, Version=4.3.5.2040, Culture=neutral, PublicKeyToken=663f351905198cb3' or one of its dependencies. The system cannot find the file specified.'

Why does it need spire.pdf when i am working with a microsoft doc file?
The doc file is in the attachements(Sjabloon.rar) and made by Microsoft Word.

JCC
 
Posts: 4
Joined: Mon Aug 20, 2018 11:28 am

Thu Aug 23, 2018 3:29 am

Hello,

Thanks for your interests in Spire.Doc.
Theoretically, Loading word file doesn't need Spire.Pdf.dll, but for some functions, Spire.Doc.dll has a dependency on Spire.Pdf.dll. Hence, you'd better reference all the dlls ( Spire.Doc.dll, Spire.Pdf.dll, Spire.License.dll ) into your project to avoid this problem. Besides, if you encounter some other issues with our Free version, we suggest upgrading to our commercial version Spire.Doc Pack(hot fix) Version:6.8.11, since it is stronger and more stable than the free version. Please feel free to write back if there is any doubt.

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Thu Aug 23, 2018 6:11 am

Hi!

Thank you for the response. The only purpose we are using spire.doc for is replace placeholder texts in our confirmation documents in a wcf service that runs on a server that does not have Office on it.

Because of that i found it weird that there is a 'hard' dependency. My thoughts about this would be that you would have a Spire.doc for all the 'word only' executions, and maybe a Spire.DocPdf for 'handling word' with a pdf dependency if you need pdf executions.

Thank you again for the answer.

Kind regards,
Walter

JCC
 
Posts: 4
Joined: Mon Aug 20, 2018 11:28 am

Thu Aug 23, 2018 9:45 am

Hi,

Thanks for your quick response.
In fact, you could use other tool (such as ILMerge ) to merge our dlls into one, please refer to following tutorial, and kindly note that you need to set the following value in the ILMerge.props file. Hope it could help.
<ILMergeAllowDuplicateType>*</ILMergeAllowDuplicateType>

https://nicknow.net/dynamics-crm-ilmerge-dll-plugin/

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Thu Aug 23, 2018 2:14 pm

Lisa.Li wrote:Hi,

Thanks for your quick response.
In fact, you could use other tool (such as ILMerge ) to merge our dlls into one, please refer to following tutorial, and kindly note that you need to set the following value in the ILMerge.props file. Hope it could help.
<ILMergeAllowDuplicateType>*</ILMergeAllowDuplicateType>

https://nicknow.net/dynamics-crm-ilmerge-dll-plugin/]https://nicknow.net/dynamics-crm-ilmerge-dll-plugin/

Sincerely,
Lisa
E-iceblue support team


THnx for the reply!
That looks interesting. Does this not interfere with TOS or give licensing issues for the free version?
Maybe provide a 'official' merged DLL in the future?

Edit 24-08-2018
Tried merging but the referenced external assemblied don't seem to be merged. With referenced assemblied i am refering to the spire.*.dll files.

I also tried using a ILMerge GUI(https://bitbucket.org/wvd-vegt/ilmergegui) which i tried to merge, but using that i got a message that spire.pdf or spire.license where still listed as external references in the target assembly.

Is thare a possibility that in the future a merged assembly could be made by the developers since they probablt have the know how about how to do it through their sourcecode.

JCC
 
Posts: 4
Joined: Mon Aug 20, 2018 11:28 am

Fri Aug 24, 2018 10:16 am

Hi,

Thanks for your feedback.
The merged dll indeed interfere with the license of our paid version. But it has no interference on free version, because the free version is totally free and it doesn't need license. And please download Merged Dll (Spire.merged.dll) which is merged from our Spire.Doc free version, please check if it could fulfill your requirement. The ILMerge tool I downloaded is from following link and the commond.PNG shows the details of merging dlls.
https://www.microsoft.com/en-us/download/details.aspx?id=17630

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Fri Aug 24, 2018 2:13 pm

Thank you, the dll works!

Thnx for all the help!

JCC
 
Posts: 4
Joined: Mon Aug 20, 2018 11:28 am

Mon Aug 27, 2018 1:10 am

Hi,

Glad to hear that! If you encounter any issue related to our products in the future, just feel free to contact us. Wish you all the best!

Sincerely,
Lisa
E-iceblue support team
User avatar

Lisa.Li
 
Posts: 1261
Joined: Wed Apr 25, 2018 3:20 am

Return to Spire.Doc