I’m trying to print a barcode without a caption or text above or below, but I cannot find the way to remove the “Aspose” title above.
Here’s my code and attached is a sample file with the result:
PLEASE ADVISE.
BarCodeBuilder builder = new BarCodeBuilder();
MemoryStream imgStream = new MemoryStream();
builder.SymbologyType = Symbology.Code128;
builder.ImageQuality = ImageQualityMode.Default;
builder.CodeText = “123456”;
builder.CodeLocation = CodeLocation.None;
builder.CaptionAbove.Visible = false;
builder.Save(imgStream, ImageFormat.Bmp);
Aspose.Pdf.Pdf pdf = new Aspose.Pdf.Pdf();
Section section = pdf.Sections.Add();
Aspose.Pdf.Image paragraph = new Aspose.Pdf.Image(section);
paragraph.ImageInfo.ImageFileType = ImageFileType.MemoryBmp;
paragraph.ImageInfo.OpenType = ImageOpenType.Memory;
BinaryReader reader = new BinaryReader(imgStream);
imgStream.Position = 0L;
paragraph.ImageInfo.MemoryData = reader.ReadBytes((int)imgStream.Length);
section.Paragraphs.Add(paragraph);
pdf.Save(“c:\BarCode.pdf”);
imgStream.Close();
Hi George,
Hi George,
//Instantiate an instance of license
and set the license file through its path<o:p></o:p>
Aspose.BarCode.License license = new Aspose.BarCode.License();
license.SetLicense(@"C:\Projects\Common\Aspose.Total.lic");
Aspose.BarCodeRecognition.License lic = new Aspose.BarCodeRecognition.License();
lic.SetLicense(@"C:\Projects\Common\Aspose.Total.lic");
// Create a PDF license object
Aspose.Pdf.License license = new Aspose.Pdf.License();
// Instantiate license file
license.SetLicense(@"C:\Projects\Common\Aspose.Total.lic");
Another way, you can include it as an embedded resource. To include the license file as an embedded resource, please visit our documentation page here.
Please let me know in case of further assistance and comments.
Imran:
I sent to you again my Aspose.Total.lic license file, zipped. Is there any issue with the license file that is not allowing me to use the Aspose.Barcode?
My guess is that there’s a license issue here.
I already ran the code setting the license for both Aspose.Pdf and Aspose.Barcode as you suggested and got the same results.
PLEASE ADVISE.
Thanks,
Jorge
Hi George,
Aspose.BarCode.License
license = new Aspose.BarCode.License();<o:p></o:p>
license.SetLicense(@"C:\AB\test35\Aspose.Total.lic");
BarCodeBuilder builder = new BarCodeBuilder();
builder.SymbologyType = Symbology.Code128;
builder.ImageQuality = ImageQualityMode.Default;
builder.CodeText = "123456";
builder.CodeLocation = CodeLocation.None;
builder.CaptionAbove.Visible = false;
builder.Save("C:\\AB\\test35\\test.bmp", ImageFormat.Bmp);