Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Friday, March 9, 2007 12:39:17 AM(UTC)

ashutak  
ashutak

Groups: Registered
Posts: 4


Hi Everyone

I am trying this sample code provided in the documentation of  lead tools version 15  to write on the .tif file but i am not able to see the string which is getting written . Please help.........

Moreover I need to write a bar code1D on to an raster image file of any format Can anyone send me the code.

Regards

Ashutak

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, March 12, 2007 11:18:45 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

What is the exact sample code in the documentation that you are trying to use?
About writing Barcode1D on Raster image, the details depend on the programming interface (API, C++ Class Library, DotNet Class Library) that you use. What is the programming interface that you use?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, March 13, 2007 1:37:54 AM(UTC)

ashutak  
ashutak

Groups: Registered
Posts: 4


Thanks Maen,

I found out what was the problem , actually i was not saving the file where i was writing.Could U please help me with the new problem which has come up. I want to use a barcode which can contain atleast 17 digits representing the( company prefix and patient id) which type data structure shall i use, ( i am writing the code in c# and the property which i require is BarcodeSearchTypeFlags)

BarcodeSearchTypeFlags.Barcode1dUccean128 property  its not working as it can be used only for reading the bar codes and not for writing them.

 

Thanks and Regards

ashutak

 
#4 Posted : Tuesday, March 13, 2007 11:15:24 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

Can you please send me a code snippet that shows how exactly you are trying to write the barcode on your image?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Wednesday, March 14, 2007 8:11:14 PM(UTC)

ashutak  
ashutak

Groups: Registered
Posts: 4


public void PointOfSaleItemsEAN13(string txtBox1)

{

BarcodeEngine.Startup(BarcodeMajorTypeFlags.Barcodes1d);

RasterCodecs.Startup();

codecs = new RasterCodecs();

codecs.ThrowExceptionsOnInvalidImages = true;

 

try

{

image = codecs.Load(@"D:\LeadTool\LeadTools\Images\sample1.tif");

// Initialize linear barcodes

BarcodeEngine.Startup(BarcodeMajorTypeFlags.Barcodes1d);

barEngine = new BarcodeEngine();

BarcodeData data = new BarcodeData();

System.Drawing.Rectangle rc = new Rectangle(50, 50, 300, 250);

data.Unit = BarcodeUnit.ScanlinesPerPixels;

data.Location = rc;

data.SearchType = BarcodeSearchTypeFlags.Barcode1dEan13;

string[] barcodeText;

barcodeText = new string[1];

barcodeText[0] = strCompanyPrefix+txtBox1;

data.Data = BarcodeData.ConvertFromStringArray(barcodeText);

BarcodeColor barColor = new BarcodeColor();

barColor.BarColor = Color.Black;

barColor.SpaceColor = Color.White;

Barcode1d bar1d = new Barcode1d();

bar1d.Direction = BarcodeDirectionFlags.Horizontal;

bar1d.OutShowText = true;

bar1d.ErrorCheck = true;

bar1d.StandardFlags = Barcode1dStandardFlags.Barcode1dMsiModulo10 |

Barcode1dStandardFlags.Barcode1dFast |

Barcode1dStandardFlags.Barcode1dCode11C;

 

BarcodeWritePdf barPDF = new BarcodeWritePdf();

BarcodeWriteDatamatrix barDM = new BarcodeWriteDatamatrix();

barDM.Justify = BarcodeJustifyFlags.Right;

barDM.FileIdHigh = 0;

barDM.FileIdLow = 0;

barDM.GroupNumber = 0;

barDM.GroupTotal = 0;

barDM.XModule = 0;

BarcodeWriteQr barQR = new BarcodeWriteQr();

barEngine.Write(image, data, barColor, BarcodeWriteFlags.UseColors | BarcodeWriteFlags.DisableCompression, bar1d, barPDF, barDM, barQR, Rectangle.Empty);

BarcodeEngine.Shutdown();

codecs.Save(image, @"D:\LeadTool\LeadTools\Images\sample2.tif", RasterImageFormat.Tif, 24);

}

catch (BarcodeException ex)

{

MessageBox.Show(ex.Message);

}

RasterCodecs.Shutdown();

}

 

This is the modified code it is working fine now the line in bold was the one missing from the demo write method in the documentation.

 
#6 Posted : Saturday, March 17, 2007 11:01:33 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Hello,

Your code indicates you are using EAN 13 barcode. This type only supports 12 digits. If you want more than that, such as 17 digits, you can use other barcode types, including Code 3 of 9, CODABAR and Code 128.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.151 seconds.