FAQ
Hi,


I have a PDF document which consist of barcode characters. Now how can I retrieve that bar-coded value programmatically. When I googled I found a tool called Pypdf which provides a function called 'PdfFileReader'

To read the PDF file, but how can I read the barcode form the existing PDF. Any solution?





In Reportlab I can do the following code to generate barcode and to get the value of that barcode



barcode=code39.Extended39("123456789",barWidth=0.2*mm,barHeight=8*mm)



bc = Paragraph("Barcode value: %s" % barcode.value, STYLES['Normal'])



document.append(bc)

But how can I achieve this from the existing PDF document??

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110628/8f39a19e/attachment-0001.html>

Search Discussions

  • Asif Jamadar at Jun 28, 2011 at 5:59 am
    Hi,


    I have a PDF document which consist of barcode characters. Now how can I retrieve that bar-coded value programmatically. When I googled I found a tool called Pypdf which provides a function called 'PdfFileReader'

    To read the PDF file, but how can I read the barcode form the existing PDF. Any solution?





    In Reportlab I can do the following code to generate barcode and to get the value of that barcode



    barcode=code39.Extended39("123456789",barWidth=0.2*mm,barHeight=8*mm)



    bc = Paragraph("Barcode value: %s" % barcode.value, STYLES['Normal'])



    document.append(bc)

    But how can I achieve this from the existing PDF document??

    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: <http://mail.python.org/pipermail/python-list/attachments/20110628/fdfca81c/attachment.html>
  • Robin Becker at Jun 28, 2011 at 9:30 am

    On 28/06/2011 06:59, Asif Jamadar wrote:
    Hi,
    ...........
    In Reportlab I can do the following code to generate barcode and to get the value of that barcode



    barcode=code39.Extended39("123456789",barWidth=0.2*mm,barHeight=8*mm)



    bc = Paragraph("Barcode value: %s" % barcode.value, STYLES['Normal'])



    document.append(bc)

    But how can I achieve this from the existing PDF document??
    .........

    you might consider asking on the reportlab list as there is considerable
    experience there about pdf in general.

    It's unlikely that you will be able to easily discern which string/text in the
    pdf corresponds to the barcode values that you are interested in.

    PDF does allow things called annotations which reportlab can generate.

    Alternatively you can generate an invisible string which may make more sense
    than the simple barcode value. So when you draw the barcode you also need to add
    the magic string using some prefix/postfix that allows easy extraction with
    pypdf or similar eg

    "===radamajfisa==3456789===radamajfisa===". Your text extractor should be
    able to find this without too much trouble.
    --
    Robin Becker

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 28, '11 at 5:58a
activeJun 28, '11 at 9:30a
posts3
users2
websitepython.org

2 users in discussion

Asif Jamadar: 2 posts Robin Becker: 1 post

People

Translate

site design / logo © 2023 Grokbase