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.

Tue May 18, 2021 7:12 pm

Hello,

Could someone post how I can reference the license in the Powershell script?
My code works well except that it does not access the license file.

Add-Type -Path "Spire.Doc.dll"
$doc=New-Object -TypeName Spire.Doc.Document
$doc.LoadFromFile("d:\temp\sgb.docx")
$doc.SaveToFile("d:\temp\sgb.pdf", [Spire.Doc.FileFormat]::PDF)

Conversion works but puts the evaluation message in the PDF. We have the Spire.Doc Pro license.
Thanks.

workmethods
 
Posts: 2
Joined: Sat Jun 01, 2013 12:06 pm

Wed May 19, 2021 6:54 am

Hello,

Thanks for your inquiry.
You can directly place the license file in the same directory as the dlls you are referencing, as shown in the attached screenshot. Or you can refer to the following code to apply your license by the license key.
Code: Select all
Add-Type -Path "Spire.Doc.dll"
Add-Type -Path "Spire.License.dll"
[Spire.License.LicenseProvider]::SetLicenseKey("Your license key")
$doc=New-Object -TypeName Spire.Doc.Document
$doc.LoadFromFile("Sample.doc")
$doc.SaveToFile("result.pdf", [Spire.Doc.FileFormat]::PDF)


If there are any other questions related to our products, just feel free to contact us.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Wed May 19, 2021 7:29 pm

Thanks a lot. Your both suggestions worked really well.
You might want to update your documentation as I did not find a reference to the method you mentioned in your call. I had issues with the enumeration for EPUB. Your documents reference as E_Pub. But, actually Epub works.
Additionally, people are using your software with scripting languages like PHP and PowerShell. Hence, you should include samples for these languages.
Again. thanks for a prompt response.

workmethods
 
Posts: 2
Joined: Sat Jun 01, 2013 12:06 pm

Thu May 20, 2021 3:41 am

Hello,

Thanks for your feedback.
Regarding the issue “Your documents reference as E_Pub” you mentioned, could you please help us point out which document reference has this the problem? Thanks in advance for your assistance.

Besides, we will consider adding some samples for these languages. Thanks for your suggestions.

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Fri May 28, 2021 11:25 am

Hello,

Greeting from E-iceblue!
How is your issue now? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Return to Spire.Doc