How to Use a Custom Delimiter in an Acrobat PDF Barcode
Question details
The user wants to encode PDF form field values in a barcode using a custom delimiter instead of the default XML or tab-delimited data.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating or modifying a PDF form that requires barcode generation tailored to a specific scanning software's delimiter requirements.
- Observed behavior
- The user needs a method to replace the default tab delimiter with a custom character, such as a pipe (|), to ensure compatibility with their barcode scanner.
Ensure you have access to the PDF form in editing mode and that your target scanning software is configured to properly interpret the custom delimiter you plan to use.
Use Custom Calculation JavaScript in Acrobat
Modify the barcode field properties using Acrobat's generated code to swap the default tab delimiter for a custom one.
Acrobat provides built-in options for XML and tab-delimited barcode data. By using the custom calculation JavaScript option, you can leverage Acrobat's auto-generated script and simply swap out the delimiter character to meet your scanning software's requirements.
Open your PDF form in Adobe Acrobat and enter Form Editing mode. Right-click the target barcode field and select 'Properties' from the context menu.
Navigate to the 'Calculate' tab. Initially, choose the tab-delimited option so that Acrobat automatically generates the baseline JavaScript code needed for the barcode.
Change the selection from the tab-delimited option to 'Custom calculation script'. This will reveal the generated code in the text editor.
Locate the tab delimiter in the script (usually represented by '\t') and replace it with your desired custom character, such as the pipe character ('|').
Click 'OK' to save your script changes and close the properties window. Test the barcode functionality using your designated scanning software to verify data is extracted correctly.

Manage PDF Forms Easily with WPS Office
While highly specific barcode scripting is unique to Adobe Acrobat, WPS Office provides a free, lightweight, and incredibly capable alternative for comprehensive PDF document management and Microsoft Office file editing. Its familiar interface ensures seamless transition and everyday ease of use.

Frequently Asked Questions
Can I use any character as a custom delimiter in a PDF barcode?
Yes, you can use most standard ASCII characters like a pipe (|), comma (,), or semicolon (;). However, you must ensure that your downstream barcode scanning software is configured to recognize the specific character you choose as the separator.
Why does my custom delimiter script not work after saving?
This usually happens if there is a syntax error in your JavaScript. Double-check the custom calculation script to ensure you only replaced the delimiter string and didn't accidentally remove any surrounding quotation marks or semicolons from the Acrobat-generated code.
Do I need to write the barcode calculation JavaScript from scratch?
No. Adobe Acrobat will automatically generate the foundational code if you initially select the tab-delimited formatting option in the Calculate tab. You simply switch over to the custom view and edit the delimiter variable.
Is it possible to use XML instead of delimited data for PDF barcodes?
Yes, Acrobat natively supports XML data encoding for barcodes. You can select the XML format option directly from the barcode field's properties dialog without needing to configure any custom JavaScript.




