PrintBarcode and PDFBarcode Library

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post by Psychophanta »

Thanks ABB!
Now waiting for 2-Dimensional barcodes :)
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PrintBarcode and PDFBarcode Library

Post by ABBKlaus »

Update :
Regards Klaus
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by DoubleDutch »

Thanks for the update.

Psychophanta: +1
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by Psychophanta »

Yeah! Thanks for the update.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
nicolaus
Enthusiast
Enthusiast
Posts: 456
Joined: Tue Aug 05, 2003 11:30 pm
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by nicolaus »

Hi ABBKlaus,

i have a problem with barcode as CODE128 and a FNC3.
i will create barcodes what start with FNC3, how i can do this with your libs?
Can you show me a smal example?

Thanks and regards,
Nico
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PrintBarcode and PDFBarcode Library

Post by ABBKlaus »

Hi Nicolaus,

please have a look at the sourcecode for label "print_barcode_code128:", there you will find the translationtable for the codesets A / B / C.

FNC3 will be equal to 96 :

Code: Select all

pdf_Barcode_Code128(x,y, Chr(96)+"B123456789",h1,w3,#PDF_TEXT_BOTTOM|#PDF_TEXT_RIGHT,xoffset,yoffset,#PDF_BARCODE_CODE128_AUTO)
BR Klaus
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: PrintBarcode and PDFBarcode Library

Post by Thorsten1867 »

Hi!
How can I center the barcode on a label (or calculate the width)?
The width seems to be different, if I create barcodes with numbers from 1 to 20.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PrintBarcode and PDFBarcode Library

Post by ABBKlaus »

update :

- added barcode width calculation

See first post for more details.

BR Klaus
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: PrintBarcode and PDFBarcode Library

Post by Thorsten1867 »

Great! Thanks! :-)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
oakvalley
User
User
Posts: 77
Joined: Sun Aug 08, 2004 6:34 pm
Location: Norway
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by oakvalley »

Hi AbbKlaus,

Your PrintBarcode and PDFBarcode Library are really great! Thanks for making them available.

However, I believe there is a bug regarding CODE128. I'm unable to use space characters in my text, but its possible for CODE39.

Example CODE128 AUTO - space not included, missing:
[code]
chars_cm.f= 1.4652
pdf_Create("P","mm","1700.99,566.99")
pdf_AddPage()
pdf_SetFont("Arial","",20)
w.f=pdf_Barcode_Code128(10,40,"THIS IS A TEST",40,chars_cm.f,#PDF_TEXT_TOP|#PDF_TEXT_RIGHT,0.2,1,#PDF_BARCODE_CODE128_AUTO)
pdf_Text(20,80,barcode$)
Define File$="Tutorial01 Barcodes.pdf"
pdf_Save(File$)
RunProgram(File$)
[/code]

Example CODE39 - same code, but space is visible:
[code]
chars_cm.f= 1.4652
pdf_Create("P","mm","1700.99,566.99")
pdf_AddPage()
pdf_SetFont("Arial","",20)
w.f=pdf_Barcode_Code39(10,40,"THIS IS A TEST",40,chars_cm.f,#PDF_TEXT_TOP|#PDF_TEXT_RIGHT,0.2,1,#False)
pdf_Text(20,80,barcode$)
Define File$="Tutorial01 Barcodes.pdf"
pdf_Save(File$)
RunProgram(File$)
[/code]


In addition, I believe that the error? for CODE128 not accepting space also makes the checksum wrong.
The barcode graphics does not look the same if using other alternative barcode programs/web plugins with the same CODE128 and set to AUTO.

Regards Stone
Regards Stone Oakvalley
Currently @ PB 5.70
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PrintBarcode and PDFBarcode Library

Post by ABBKlaus »

@oakvalley,

you are right, its a bug.

Bugfixed Versions can be downloaded here (Sources only) :
http://purebasicpower.de/downloads/PDFBarcode105.ZIP
http://purebasicpower.de/downloads/PrintBarcode110.ZIP

Regards
Klaus
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by IdeasVacuum »

Hello Klaus

Do you intend to update these libs for PB5.43LTS and PB5.50?
I see PrinterLib is needed too. PurePdf (source) is working fine with PB5.43LTS.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by IdeasVacuum »

...in fact, PB5.50's new vector drawing lib looks ideal for barcodes since the line thickness (stroke) can be accurately controlled.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
oakvalley
User
User
Posts: 77
Joined: Sun Aug 08, 2004 6:34 pm
Location: Norway
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by oakvalley »

I hope the libs gets updated, in fact, because of the CODE128 error I reported, I had to use external Zint Barcode Generator (batch files and some tricks) to create barcodes instead in my "not final yet" project here at work.

VectorLib idea seems like an interresting approach!
Regards Stone Oakvalley
Currently @ PB 5.70
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PrintBarcode and PDFBarcode Library

Post by IdeasVacuum »

The vector lib is looking very good for the job, works great in fact. I think using GDI+ would probably be equal for this purpose.

I knew nothing about bar codes before and they are an oxymoron - in essence very easy but there is a lot of detail needed to meet the required standards.

Found this site useful: https://www.gs1uk.org/support/our-stand ... ds-library
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply