Expand my Community achievements bar.

Total Newbie

Avatar

Former Community Member
Hi All,



I'm a complete newbie to LiveCycle, but I am a programmer and I do know how I want my PDF forms to behave.



I'll just start with what is hopefully a simple question (many more to follow) ;-)



Does anyone have a "hello world" type code sample to change a barcode value based on the users input into one or more form fields?



TIA



Cheers



-Bryan
4 Replies

Avatar

Former Community Member
This can actually be done with very minimal JavaScript.



Basically the "value" of a Barcode object is changed using the .rawValue property.



Let's say for example, I go to the Custom library and drag and drop the "Address Block" on to my page. I then drag and drop the "Paper Forms Barcode" object from the Standard library on to the same form (not necessarily on the same page).



I then look at the object names of the fields from the address block and I see "Name", "Address", "City", "State", "ZipCode", and "Country".



If you would like the dynamic Barcode to only contain the Name and Address values then you would turn off the "Automatic Scripting" for the Barcode and then in the "Calculate" event add the following:



this.rawValue = Name.rawValue + "| + Address.rawValue;



If you don't need the Barcode to update at the same time the form is being filled out, you can also put the same code in the prePrint event so the Barcode is updated just prior to printing.



Take a look at the following URL if you would like to see it in action:



http://adobe.breezecentral.com/barcodedformsusingrawvalue/

Avatar

Former Community Member
Hi Dan,



Creating a dynamic Code 128 Barcode will work with the "this.rawValue = Name.rawValue;" code in the Barcode but you will be VERY limited in the number of characters.



If you had a Code 128 Barcode of say 3.625in in size and the data length set to 30, you could encode the alphabet easily but then start to run out of space and of course the scans will be unreliable if you encode that much data and then fax the document.



You should consider the 1D Barcodes as more useful for form identification than for data capture.



PDF417 would of course be a better choice to encode data but would require licensing of the technology although the Stand Alone (ST) version is very inexpensive.



Feel free to call me direct +1-800-866-8006 ext. 53840 if you'd like additional details.