Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

2D Barcode Sample Form

Avatar

Former Community Member
I am looking for a sample form with 2 D paper barcode form where in the barcode is mapped to all the fields on the form i.e. the bar code captures all the fields on the form.



Thanks & Regards,

-Jiya.
5 Replies

Avatar

Former Community Member
Jiya,



The default property for the 2dbarcodes is to capture all fields in the subform the barcode is in.



So if you drag your barcode to the same subformarea (in the hierarchy browser) as your fields, you've got it.



I think this is quite well explained in the help file of the barcode object.



Sanna

Avatar

Former Community Member
Thanks Sanna for your response. But what I am looking for is custom controlled code. Basically, my problem is in my forms the data is too large to be fit into barcode, so I am figuring out how to handle this situation. One way I came up is to use different bar codes but I could not find out how to associate the bar codes to different surface. I am using the following code:



function depends(node)

{

for (var i = 0; i < node.nodes.length; ++i)

{

var child = node.nodes.item(i);

if (child.isContainer)

depends(child);

}

}



depends(F.P1); // F is the form node and P1 is the Page name

this.rawValue = xfa.datasets.saveXML();



but this is not working, the barcode gets greyed out when I preview it in reader.



Any relative pointer is most welcome.



Thanks,

-Jiya.

Avatar

Former Community Member
I am sure I saw another issue along the similar lines in one of the FAQ topics, have a look there too.



Your code looks good (having not tested it) - it could be greyed out if you have more data on the form than what the barcode can handle.



You can build any string (eg write script to build the exact string) you want to store in the barcode.



If you look into the Designer help file, under keyword "paper forms barcode object" you'll be able to find the whole explanation, including sample code for only inlcuding named fieldsin the "encoding data in a subform" section. Optionally base the selection using mapping to individual subforms, which could allow you to group the data without scripting.



Good luck,

Sanna

Avatar

Former Community Member
Hello,



one thing you should also keep in mind: 2D barcodes are only properly working in Reader when the PDF is rights-enabled for 2D-barcode decoding. When it is not rights-enabled it also gets more quickly greyed out, however the data will not be properly stored in the barcode.



Regards, Karin

Avatar

Former Community Member
Hi,



I was trying other work around for this problem and when I try to use any Encode option other than custom e.g. "XML Form Data" or "Tab delimited Form Data", I get an error stating "Error reading Paper Forms Barcode script" and encode remains the same i.e. custom.



I am using Designer 7.0.5 and Reader 7.0.7.



Any idea what can be the issue?



Thanks,

-Jiya.