Bashabi
Bashabi

Reputation: 706

How to replace a old aspose licence with a new one in vb.net

our product is Aspose.Words for .NET

I have read this link http://www.aspose.com/docs/display/wordsnet/Licensing

We had implemented the aspose license previously (by former developer) in our web application.

this is our code for extracting document .

Imports Aspose.Words
Imports System.IO

Public Class Converter
    Public Shared Sub ConvertDocument(ByRef docPath As String, ByRef expPath As String)



        Dim license As New Aspose.Words.License()
        license.SetLicense("Aspose.Words.lic")
        Dim info As Aspose.Words.FileFormatInfo = FileFormatUtil.DetectFileFormat(docPath)

        Dim format As String = info.LoadFormat.ToString().ToLower()

        If Not format = "pdf" Then

            Dim doc As New Aspose.Words.Document(docPath)
            doc.Save(expPath)
        Else

            ' This object will help us generate the document.
            Dim builder As New DocumentBuilder()

            ' You might need to specify a different encoding depending on your plain text files.
            Using reader As New StreamReader(docPath, Encoding.UTF8)
                ' Read plain text "lines" and convert them into paragraphs in the document.
                Dim line As String = Nothing
                line = reader.ReadLine()
                Do While line IsNot Nothing
                    builder.Writeln(line)
                    line = reader.ReadLine()
                Loop
            End Using

            builder.Document.Save(expPath)
        End If

        End Sub
End Class

All the setup for aspose was done. After that our aspose license expired and we did not upgraded that for a while. Then we again applied for a temporary license for 30 days.

Now we have the new license for next one year. What do I have to do to apply the new license. Is it ok if I just replace the old licence file ( Aspose.Words.lic) with the new license file ( Aspose.Words.lic)

Or do I need to change anything in the XML file (Aspose.Words.xml) inside Bin folder as well.

Upvotes: 0

Views: 706

Answers (1)

Shahzad Latif
Shahzad Latif

Reputation: 1424

You do not need to change anything in XML file or license file. If you're accessing the license from a file, you can simply replace the old file with the new one.

If you're using the license as an embedded resource, you can remove existing resource and then embed the new license file as a resource.

I hope this helps.

Disclosure: I work at Aspose.

Upvotes: 2

Related Questions