FAQ

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

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
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 © 2022 Grokbase