Problems with licence in Aspose BarCode


#1

Please help!

We are using both Aspose.Word & Asspose.BarCode. Attached are the Word Document Template I’m using and the resultant Word Document produced, along with Code Snippets on what I’m doing.

We have paid our licence and have an Aspose.Custom.lic file. Aspose.Word is working correctly (i.e no random characters and no red evaluation text in the document), but the BarCode being produced still contains the string “Aspose.Demo”.

Am I doing something wrong with the way I’m using these two products together?

Please help. BTW, I need an urgent reply on this as we are due to launch this part of our new product in a matter of days!


#2

Dear philliplnce,

Use different license class to set license file for barcode.

Aspose.BarCode.License Lic = new Aspose.BarCode.License();
lic.SetLicense();

For your code:
Private Sub HandleBarCode(ByVal sender As Object, ByVal e As MergeImageFieldEventArgs)
Dim imageStream As System.IO.MemoryStream = New System.IO.MemoryStream
Dim image As Bitmap
If e.FieldName.ToUpper() = “BARCODE” Then
Dim path As String = MapPath("…")
//change here!!!
Dim license As Aspose.BarCode.License = New Aspose.BarCode.License
Try
license.SetLicense(System.IO.Path.Combine(path, “Aspose.Custom.lic”))
Catch ex As Exception
End Try
Dim codeString As String = “AP” & w_accnt_id.ToString.PadLeft(9, “0”)
Dim BarCode As LinearBarCode = New LinearBarCode(codeString, Symbology.Code39Extended)
BarCode.ImageUnit = GraphicsUnit.Millimeter
BarCode.BarHeight = 12
BarCode.ShowBorder = False
image = BarCode.BitmapImage
’ Now cast image as a stream
image.Save(imageStream, System.Drawing.Imaging.ImageFormat.Bmp)
ElseIf e.FieldName.ToUpper() = “LOGO” Then
If reportImage Is Nothing Then
Dim logoCMD As SqlCommand = New SqlCommand(“SELECT report_image FROM tblServices WHERE service_id=” & dvwServices.Item(0).Row(“service_id”), dbdatabase.dbConnection)
logoCMD.Transaction = wTransaction
Dim myReader As SqlDataReader = logoCMD.ExecuteReader(CommandBehavior.SequentialAccess)
myReader.Read() ’ Obtain the row from the reader
imageSize = myReader.GetBytes(0, 0, reportImage, 0, 0)
ReDim reportImage(imageSize - 1)
imageSize = myReader.GetBytes(0, 0, reportImage, 0, imageSize)
myReader.Close()
End If
imageStream.Write(reportImage, 0, imageSize)
Else
goto_error_handler(“No support for image field '” & e.FieldName & “’”, “HandleBarCode”, “”)
End If
'Now the mail merge engine will retrieve the image from the stream.
e.ImageStream = imageStream
End Sub


#3

Dear philliplnce,

If you still have any problem, talk to me in MSN: guangzhou@aspose.com

kyle


#4

Makes perfect sense! Thanks