powertieke / librecode-acrobat

Libre Barcode128 string encoder for use in Adobe Acrobat JavaScript
3 stars 0 forks source link

where to paste the code #1

Open putout opened 2 years ago

putout commented 2 years ago

good GIT project

where do i paste the two codes, the readme was vague

tried on focus, checksum validation to no avail.

image

image image

powertieke commented 2 years ago

Hey, thanks for the interest. I have been meaning to get back on this, but unable to right now.

I created a example PDF where you can see it working. The two files (fontmap and encoder) are placed in the 'document' javascript. The code that performs the transformation is embedded in the form field.

ExamplePDF_Librecode_Acrobat.pdf

putout commented 2 years ago

thank you so much, i opened it both in chrome & acrboat with the librecodefont thats nice of to volunteer to help others. i really appreciate it.

in acrobat pro 2020 DC EM000123000LB code (tracking number lets say)

before i click away/mouse over image

On action/Focus/click away image

but in your on Blur Javascript entry, in the PDF you provided, where is it calling the code128Encoder variable from?

The strange thing is i been programming with Visualbasic for over 20 years and todays software has so much factors to make things work i feel bad for others..

putout commented 2 years ago

image

powertieke commented 2 years ago

Can you try with the librebarcode font without human readable text? Code128 has a 'compression' system that allows you to store double digits in a single code point. This does not work with the human readable version.

Usually I create a separate form field for the human readable.

Here is the code that calls the code128Encoder. You get there from the actions tab in the properties of the form field.

Schermafbeelding 2021-12-12 om 09 57 12

The functions and fontmap code are in the 'document javasctripts' in scripting mode.

Schermafbeelding 2021-12-12 om 10 01 21
powertieke commented 2 years ago

image

It looks like you encoded the string twice. I see an extra checksum at the end of the string.

putout commented 2 years ago

thanks for replying/helping. i only entered the data to be encoded once, i also installed: Libre Barcode 39 is without text below. (and selected) and redownloaded your sample file and selected the Liber Barcode 38

EM000123000LB (copied that directly out the field below to here) image

clicking away: image image

powertieke commented 2 years ago

You need the LibreBarcode 128 font without human readable (however, since the decoding issue came from multiple encoding, i think the one with human readable should also work, but the readable will be messed up). Code39 is a very different barcode (less encodable chars, no compression (so bigger codes), no checksum) which is less versatile, but easier to use.

If you want to use a code39 you do not need any kind of encoder. You just need to put the string between to asterisks () like so : *THIS123WORKS\

Here is a link to the font I use most of the time: Libre Barcode 128

putout commented 2 years ago

Hi there. so all it was i was using the wrong font ? so its working. the interesting thing is LibreBarcode 128 was the one i selected first last week but had the same problem. it must of worked for everyone else probably no one had bugged u as i dont see any comments . thank u again

powertieke commented 2 years ago

There is also the chance that you are the first one to really try :).

You've gotten me motivated to put a little more work into this project, to make it more useful to other people. I'll prepare a more attractive and user friendly example PDF and some instructions for usage.

Thank you for the interest!

putout commented 2 years ago

well thats kind of you. I still use the sricpt to populate the barcode field as file fname without EXT but it contlicted im not sure why.. .

putout commented 2 years ago

woop sent message premature. . brb

putout commented 2 years ago

I hope you been well I have spent naother 5 hours trying ot make it work the barcode is formed by the filename, without EXT. but only works sometimes........ i seriously considering moving everything back to windows XP...........

powertieke commented 2 years ago

Can you paste the code so I can see how you are accomplishing this?

putout commented 2 years ago

too be honest it got so confusing i couldnt even get teh code you provided me to work anymore. :(