Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.

[RT 133048] Documentation request for barcode functionality

  • 9 Replies
  • 423 Views
*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Sat Jul 25 18:33:26 2020 automata [...] 2cm.systems - Ticket created
Subject:    Documentation-liveware 'bug'
Date:    Sun, 26 Jul 2020 00:33:15 +0200
To:    bug-PDF-API2 [...] rt.cpan.org
From:    automata [...] 2cm.systems

Good evening,

Unlike the other listed methods with options, there is no 'Valid %options' list for the Barcode Methods in the module pod (nor an example for guidance).

I tried using similar syntax to other methods as well as digging into the modules themselves, but unfortunately I'm only an occasional Perl user and couldn't get the barcode feature to work. I did also try looking for examples through web search, but was also unsuccessful there.

This appears to be an inconsistency or omission in the pod only and I have no reason to think that the code is at fault.

Many thanks for your consideration.

Best regards,

Jules
« Last Edit: February 27, 2021, 10:55:45 AM by Phil »

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation-liveware 'bug'
« Reply #1: July 25, 2020, 11:33:21 PM »
Sat Jul 25 23:29:04 2020 PMPERRY [...] cpan.org - Correspondence added

https://github.com/PhilterPaper/Perl-PDF-Builder/blob/master/examples/BarCode.pl (PDF::Builder package on CPAN) includes BarCode.pl that outputs a number of supported barcodes. You will need to change "PDF::Builder" to "PDF::API2" in the code to use PDF::API2. Hopefully they can serve as some examples.

That said, I have my suspicions about barcode support. Zooming in and out on the produced barcodes produces some unsightly results, such as bars clumping together, so I'm not absolutely sure that I implemented this barcode use correctly (assuming the library is correct), or (if I did) the library code might be wrong. Use with care. It's on my to-do list to rewrite PDF::Builder's barcode library in the near future.

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation-liveware 'bug'
« Reply #2: August 17, 2020, 07:29:34 PM »
Mon Aug 17 19:26:06 2020 PMPERRY [...] cpan.org - Correspondence added

Jules,

Have you (or anyone else) had a chance to try running the PDF::Builder examples/BarCode.pl against either PDF::API2 or PDF::Builder? Note that you don't have to install PDF::Builder; you can just grab the file off of GitHub.

As I said, I don't know if I implemented the bar code program correctly, or if the problem is in the PDF::API2 (same code in Builder) bar code library. I would appreciate some feedback on whether the bar spacing changes/"clumping" is due to my example code or if it appears to be in the original library. Anyway, between the example code and maybe some changes in the PDF::Builder POD, you may be able to understand it better.

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation-liveware 'bug'
« Reply #3: August 25, 2020, 07:15:49 PM »
Tue Aug 25 12:53:33 2020 automata [...] 2cm.systems - Correspondence added

Hi Phil,

I'm currently busy on another urgent project, so haven't had time to look further into this. I shall do so in due course though.

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation-liveware 'bug'
« Reply #4: February 27, 2021, 10:55:17 AM »
RT title changed from "Documentation-liveware 'bug'" to "Documentation request for barcode functionality"

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation request for barcode functionality
« Reply #5: April 16, 2021, 10:08:01 AM »
Wed Apr 14 18:50:48 2021 PMPERRY@cpan.org - Correspondence added

Just a note on my concerns about the example bar code mentioned earlier. I've been talking with Johan Vromans about the bar "clumping", and he suggests that it's a matter of display rounding. That is, on his 1920x1024 display he reports that there is no clumping, while on my 1368x768 laptop there is severe clumping. I printed the example (BarCode.pl) page on my consumer-grade laser printer, and indeed can *just* see that the "clumps" are made of discrete lines. However, I am concerned that a laser scanner will still be unable to properly and reliably read these bar codes. So, the matter is still open.

Fri Apr 16 10:03:30 2021 PMPERRY@cpan.org - Correspondence added

Thinking about bar codes some more, I can generate lots and lots of different codes, but without the appropriate physical SCANNERS, I can't adequately TEST them. Does anyone know if there are free (or very low cost) services to receive a PDF, print it out, and attempt to scan it? How many physically unique scanners are there -- will a scanner that reads a UPC-A be able to read a Code 128 B? Is there any organization of scanner owners who would be willing to print and test bar codes? How do you verify a bar code (also 2D and QR codes)? I can't very well go and purchase dozens of scanners and related hardware, just to test some free software! Do developers ask someone who has a need for a bar code generator AND owns scanner hardware to work with them to test a particular bar code?

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation request for barcode functionality
« Reply #6: April 18, 2021, 07:22:21 PM »
From:    automata@2cm.systems
Subject:    Re: [rt.cpan.org #133048] Documentation request for barcode functionality
To:    bug-PDF-API2@rt.cpan.org
Date:    Sun, 18 Apr 2021 22:31:15 +0200

There are some QA points listed here:

https://en.wikipedia.org/wiki/Barcode#Quality_control_and_verification

I believe that a number of codes, or at least their font reproduction, are subject to proprietary controls. It might make sense to work out what IP restrictions exist and prioritise support accordingly.

In linear codes its down to a mark (width) and space ratio which in principle you should be able to verify geometrically. The compliance of the actual code, once printed, will in any case depend on factors such as printer density and contrast which are outside the scope of the generating software; the link above does list some standards.

For QR codes, supporting mobile devices are sufficiently ubiqutous to get relatively easy test data and there are a stack of related apps -- you might try reaching out to some app developers who may have wrestled with the other side of the same problem already.

Probably you could source a testing service online, perhaps via a global freelance jobs board or similar. Probably you could also pin down a surplus scanner of modest capabilities which could be used for some go/no-go testing; again, some internet digging for others facing the same problem may prove useful.

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation request for barcode functionality
« Reply #7: April 19, 2021, 08:59:48 AM »
From:    "Alfred Reibenschuh" alfredreibenschuh@gmx.net
Subject:    Aw: [rt.cpan.org #133048] Documentation request for barcode functionality
To:    bug-PDF-API2@rt.cpan.org
Date:    Mon, 19 Apr 2021 04:51:28 +0200

hello

i would like to comment on the code that i wrote more than 15 years ago.

the barcode library had been in production for almost 10 years in my former company, printing EAN13/UPC and Code128
both on consumer-grade inkjet- and laser-printers (mostly HP) as well as some dedicated label printers.

any line-clump you might experience on-screen is a natural scaling error on behalf the pdf-viewing software or display drivers used.

any line-clump you might experience in print is usually a poorly configured output-profile (overprint?).

on consumer-grade inkjet printers the best result can be acceived with B/W, MAX Quality (eg. Fine Print) and Slow Drying Paper Settings.

the barcode software for mobiles from zxing can be used for testing as well as the online service https://zxing.org/w/decode.jspx

if you are not satisfied with the output of PDF::API2, you could switch to GD::Barcode and include the generated pixel images instead as an alternative.

cheers,

--
Alfred Reibenschuh

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation request for barcode functionality
« Reply #8: April 19, 2021, 11:15:11 AM »
Mon Apr 19 10:42:44 2021 PMPERRY@cpan.org - Correspondence added

On Sun Apr 18 16:31:20 2021, automata@2cm.systems wrote:

Quote
I believe that a number of codes, or at least their font reproduction, are subject to proprietary controls. It might make sense to work out what IP restrictions exist and prioritise support accordingly.

Anything that is restricted (by patent or copyright) I'm not interested in supporting (by the way, I am working with PDF::Builder). I don't want to use fonts for bar codes, if I can help it.

Quote
In linear codes its down to a mark (width) and space ratio which in principle you should be able to verify geometrically.

Too bad I don't have a measuring magnifier like photo-recon analysts do! About the best I can do is a magnifying glass and a ruler marked in mm. Just eyeballing the results, I find it hard to believe that a laser scanner will be able to pick apart some of these bars. That's why it would be nice to be able to test on a real system.

Quote
For QR codes, supporting mobile devices are sufficiently ubiquitous to get relatively easy test data and there are a stack of related apps -you might try reaching out to some app developers who may have wrestled with the other side of the same problem already.

I don't have a smartphone to read QR codes, but I'm sure I could find someone locally with one to try out some samples.

Quote
Probably you could source a testing service online, perhaps via a global freelance jobs board or similar. Probably you could also pin down a surplus scanner of modest capabilities which could be used for some go/no-go testing; again, some internet digging for others facing the same problem may prove useful.
Since this is free software and I don't make a penny off it, I'm reluctant to spend money on hiring someone to test, or buying any equipment (donations of time, money, or equipment accepted!). It looks like I will have to advertise for people needing specific bar code support in PDF::Builder to step up and test the results with real scanners.

If you get a chance, could you get the examples/BarCode.pl sample from PDF::Builder (PhilterPaper/Perl-PDF-Builder on GitHub) and try it out? I just want to be certain that it's producing bar codes correctly and my code around (your original) PDF::API2 bar code routines is good. There's always the chance that I screwed up something in the example code.

*

Offline Phil

  • Global Moderator
  • Hero Member
  • *****
  • 795
    • View Profile
Re: [RT 133048] Documentation request for barcode functionality
« Reply #9: April 19, 2021, 11:17:54 AM »
Mon Apr 19 11:08:33 2021 PMPERRY@cpan.org - Correspondence added

Quote
the barcode software for mobiles from zxing can be used for testing as well as the online service https://zxing.org/w/decode.jspx

I gave zxing.org a try, uploading a sample PDF bar code (Codabar), and it apparently does not accept PDF files. I used GIMP to convert it to a GIF file, and zxing said it couldn't see the bar code. I'll try playing around with it some more -- maybe it's a scale issue?