You are right: in fact I tested my application using a 30 days full licence with no restrictions but the problem still persist. I have pasted the code below: as you will see it is the code of one of the on line Demo Insert to Word, I've made few marginal changes.
Please, note that also the on line Demo Insert to Word doesn't seem to work: changing the CodeText value I always obtain the same barcode's bar sequence into the Word document, while the on line barcode web image changes correctly as soon as the CodeText is changed.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Aspose.BarCode;
using Aspose.Word;
using Aspose.BarCode.Web.UI;
public partial class BarCodeWord : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.btnSet.Click += new System.EventHandler(this.btnSet_Click);
this.btnOutput.Click += new System.EventHandler(this.btnOutput_Click);
}
//Handle btnOutput OnClick evnet, output the barcode image to word document
private void btnOutput_Click(object sender, System.EventArgs e)
{
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense("Aspose.BarCode.lic");
//Create BarCode
Aspose.BarCode.LinearBarCode linearBarCode = new Aspose.BarCode.LinearBarCode(this.txtCode.Text, this.BarCodeWebControl1.SymbologyType);
// Setting the bar code format
// linearBarCode.ImageQuality = (ImageQualityMode)Enum.Parse(typeof(ImageQualityMode), this.ddlImageQuality.SelectedValue.Trim(), true);
linearBarCode.ImageQuality = ImageQualityMode.Default;
//Create doc with Aspose.Word
Aspose.Word.Document wordDocument = new Aspose.Word.Document();
//Create builder for doc
Aspose.Word.DocumentBuilder builder = new Aspose.Word.DocumentBuilder(wordDocument);
//Insert the BarCode image into doc
builder.InsertImage(linearBarCode.BitmapImage);
// Save doc to Memory
System.IO.MemoryStream memoryStreamOutput = new System.IO.MemoryStream();
wordDocument.Save(memoryStreamOutput, Aspose.Word.SaveFormat.FormatDocument);
// Free Resources
wordDocument = null;
byte[] memoryStreamOutputBytes;
// Write all Data
memoryStreamOutputBytes = memoryStreamOutput.ToArray();
// Send as file to browser...
Response.ClearContent();
Response.ClearHeaders();
Response.AppendHeader("Content-Disposition", "inline;filename = " + "BarCode.doc");
Response.ContentType = "application/msword";
Response.AddHeader("content-length", System.Convert.ToString(memoryStreamOutputBytes.Length));
Response.BinaryWrite(memoryStreamOutputBytes);
Response.Flush();
Response.Close();
// Free Stream
memoryStreamOutput.Close();
}
private void btnSet_Click(object sender, System.EventArgs e)
{
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense("Aspose.BarCode.lic");
this.BarCodeWebControl1.CodeText = this.txtCode.Text;
BarCodeWebControl1.ShowBorder = false;
BarCodeWebControl1.BarHeight = float.Parse(TextBoxBarHeight.Text);
BarCodeWebControl1.xDimension = float.Parse(TextBoxModule.Text);
BarCodeWebControl1.CodeLocation = CodeLocation.Below;
}
}