barcode creation

General discussions about GdPicture.NET.
Post Reply
User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

barcode creation

Post by kketterman » Mon Aug 31, 2009 4:34 pm

I've updated to the latest version of the GDPicture.NET and it looks like we've lost some barcode creation methods.

I'm mainly concerned with the getwidth methods that would get the size of the barcode requirements on the document.

Are these gone, or is there another way of handling this?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Mon Aug 31, 2009 4:43 pm

Hi,

All previous barcode creation methods have been deprecated to be able to provide an new barcode witting support.

Now, the width of the barcode should be specified by you using the Barcode1DWrite method.

Let me know if you encounter problems of migration for barcode features.

With best regards,

Loïc

User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

Re: barcode creation

Post by kketterman » Mon Aug 31, 2009 5:04 pm

I was using the previous features to verify the barcode would fit on the page.

I would like to be able to produce a barcode in the bottom-right or bottom-left of a standard 8.5 x 11 page and print this barcode to a document. I have not been able to get the barcode closer than 2 inches to the bottom of the page so far. I have tried the printfit and the regular print methods.

Code: Select all

tDoc = oImaging.CreateNewGdPictureImage(1700, 2200, pixF, Color.White)

oImaging.Barcode1DWrite(tDoc, Barcode1DWriterType.Barcode1DWriterCode128, docType.Text.ToUpper, 10, 1600, 500, 75, Color.Black)
ok, n/m i'm a dumba$$...got my x's and y's mixed up....

This should be right at the bottom of the page and it is not. Am I using this wrong?

Are the dimensions for the barcode the "allowed" size or actual size meaning the barcode will "stretch" to fill my sizes specified?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Mon Aug 31, 2009 5:10 pm

Hi,

Try this

Code: Select all

oImaging.Barcode1DWrite(tDoc, Barcode1DWriterType.Barcode1DWriterCode128, docType.Text.ToUpper, 10, 1600, 500, 100, Color.Black)
1600 + 75 = 1675 (your page is 1700 pixel height so you should have a barcode height of 100) :wink:
Are the dimensions for the barcode the "allowed" size or actual size meaning the barcode will "stretch" to fill my sizes specified?
Yes.

Kind regards,

Loïc

User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

Re: barcode creation

Post by kketterman » Mon Aug 31, 2009 5:48 pm

Will any error occur if the data applied to the barcode is too much for the size specified?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Mon Aug 31, 2009 5:56 pm

If the destination area is not large enough a GdPicture status BarcodeInvalidDestinationSize is returned.

User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

Re: barcode creation

Post by kketterman » Mon Aug 31, 2009 6:05 pm

With the above code, the barcode produced is not recognizable. I am trying to recognize in the sample application.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Mon Aug 31, 2009 6:07 pm

Unfortunately I can't test it for you because I don't have the content of docType.Text.ToUpper

User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

Re: barcode creation

Post by kketterman » Mon Aug 31, 2009 6:10 pm

it is just a string from a textbox. Seems to affect long strings...

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Mon Aug 31, 2009 6:11 pm

it is just a string from a textbox
OK but which string ?

User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

Re: barcode creation

Post by kketterman » Mon Aug 31, 2009 6:16 pm

the string can be any series of words...

i tried "SAMPLE" => worked.

I tried "SAMPLE WITH CHEESE ON IT" => No barcode found and the gdpicturestatus = 0

(using the 2.0 framework)

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Mon Aug 31, 2009 6:31 pm

OK I understand.

The bars of your bar code are a bit too close.

You have 3 solutions:

1 - Scale the image before scanning barcode (consume performance)
2 - Scan barcode to a region of interest (the barcode should be into this region): See sample Barcode Recognition
3 - Enlarge your barcode destination, IE:

Code: Select all

Imaging1.Barcode1DWrite(m_CurrentImage, Barcode1DWriterType.Barcode1DWriterCode128, "SAMPLE WITH FRENCH CHEESE ON IT", 10, 1600, 800, 100, Color.Black)
Kind regards,

Loïc

User avatar
kketterman
Posts: 32
Joined: Tue Apr 21, 2009 6:55 pm

Re: barcode creation

Post by kketterman » Mon Aug 31, 2009 6:36 pm

is there any suggested way to calculate the size of the region based on the size of the barcode data?
Does each char in the barcode require a specific # of pixels?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: barcode creation

Post by Loïc » Tue Sep 01, 2009 9:47 am

Hi,
is there any suggested way to calculate the size of the region based on the size of the barcode data?
Not really. However, the processing time increase with the depth of the ROI.

NOTE: I worked few hours between my previous answer because your latest question raise me some interrogations. Therefore, I modified a bit the barcode reader to provide more accurate results on ROI. So, please make test with the current beta release which can be downloaded from https://www.gdpicture.com/download/beta/ ... re.NET.dll
Does each char in the barcode require a specific # of pixels?
Good question, but to be honest I never made any bench to find a good ratio between barcode value and barcode length. Simply because it depends both from barcode type and barcode data...

With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests