function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
catchforshivacatchforshiva 

Generate Barcode using Visualforce and Apex

Hi Fridends...

 

 

How to Generate Barcode program in apex and Visualforce?

 

 

 

Thanks & Regards

Shiva...

bvramkumarbvramkumar

I dont think this is possible in Apex. There is no graphics Api in Apex as such to draw bar code lines etc. Also, you would probably want this barcode as a thumbnail image for your product or something if I am not wrong. There are some 3rd party web services Api that can do this job for you. Google and try to find a free Api first though I feel bar code generation is always a paid service. Good luck.

catchforshivacatchforshiva

thankq for suggestion bvramkumar.

 

But to to integrate?

 

 

 

 

Thanks & Regards

Shiva

bvramkumarbvramkumar

To integrate, there are ways in Apex. For eg. you can send an HttpRequest or SOAP request etc. to the webservice to recieve the barcode you are expecting. Check this article : http://salesforcetrekbin.blogspot.in/2010/04/call-external-web-service-from.html

Santhosh KumarSanthosh Kumar

You could use some online services which provides the barcodes via URLs. For example, below service provides the bar codes for text specified in url.

 

Bar Code 

 

Url behind image is http://www.barcodesinc.com/generator/image.php?code=Your%20Text&style=325&type=C128B&width=200&height=50&xres=1&font=3

 

You can add this url to a apex:image tag and get the barcode in vf page. 

 

Please check that the service provider license is appropriate for your use.

catchforshivacatchforshiva
No. I want dynamically generate?bar code. thanks?Santhosh Kumar for giving?suggestion. ? Thanks&Regards Shiva +91 9666093013?
Santhosh KumarSanthosh Kumar

You can construct the url dynamically in VF and when it is rendered in the webpage, corresponding barcode would be displayed, something like this.

 

<apex:image value="http://www.barcodesinc.com/generator/image.php?code={!barcodeText}&style=325&type=C128B&width=200&height=50&xres=1&font=3"/>
bvramkumarbvramkumar

Hi Santosh kumar

 

Is this public PHP page free for use? Or it has license related limitations? I understand the idea that the image will have to constructed in a third party website and just integrated into salesforce.

 

Thanks

 

 

Santhosh KumarSanthosh Kumar

It varies by the vendor who provides that online service. Please check with them if that license is appropriate for you.

staceyeileenstaceyeileen

Check out the Barcode Zone app in the AppExchange.  It is free.  

admin@technossus.comadmin@technossus.com

I am facing the same issue of generating BarCodes in VF Pdf. But i do not know how can i do it.

 

Have you found any solution??


catchforshiva wrote:

Hi Fridends...

 

 

How to Generate Barcode program in apex and Visualforce?

 

 

 

Thanks & Regards

Shiva...



 

beco fuanbeco fuan
Just found two types of bar code generator:
http://www.businessrefinery.com/products/barcode_net/main.html
http://www.businessrefinery.com/products/barcode/main.html
You can have a test with these two resources. I think it will be helpful.
Roger WickiRoger Wicki
Please mark @Santhosh Kumar answer as best answer. Thank you for sharing this page, it is great, easy to use and does exactly what it should.
David Vickers 46David Vickers 46
This is one way I found to solve this. Just implement JSbarcode

 
<apex:page showheader="true"  standardController="Case">
  <!-- Example implmentation -->
  <apex:includeScript value="{!$Resource.Barcode}"/>
  
  
  <svg id="barcode"></svg>
  
 <script type ="text/javascript">
 
 JsBarcode("#barcode", "{!Case.id}",{
 fontOptions: "both",
 font :  "OCRB",
 textAlign : "center",
 Textmargin : 5,
 fontSize : 12,
 width: 1,
 height: 50
 
 });
 

  
  </script>
  <!-- formats may be an issue  JS can be found at https://github.com/lindell/JsBarcode  -->
</apex:page>

 
AlbertDevAlbertDev
Whenever we need to generate barcode or qr code, I usually install free appexchange like - Barcode and QR Code Generator (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FvIsgUAF). It is pretty handy, we can generate barcode/QR code based on configuration records. Can embed in app builder pages, visualforce, lightning components etc