We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Adding barcode to PDF


First of all, thanks to anyone who can help. I'm not able to find documentation on how to dynamically add a barcode to a PDF generated by Syncfusion libraries for Xamarin.Forms PCL.
I'm both able to generate the barcode and to display on the screen, and I'm able to build a pdf, adding dynamic text and images. But no way to include the dynamic barcode into the PDF at runtime.

Again thanks for any help.


1 Reply

AS Abirami Selvan Syncfusion Team October 2, 2015 01:20 PM UTC

Hi Nicola,


Thank you for contacting  Syncfusion support.


We have the support to draw the barcode in PDF at runtime in xamarin platform.

Please refer the below code snippet :

//Create the PDF document

PdfDocument document = new PdfDocument();

//Creates a new page

PdfPage page = document.Pages.Add();

//Create font and font style.

PdfFont font = new PdfStandardFont(PdfFontFamily.Helvetica, 12f, PdfFontStyle.Bold);

//Creates a new PdfCode128BBarcode.

PdfCode128BBarcode code128B = new PdfCode128BBarcode();

//Set the font to code128B.

code128B.Font = font;

//Set the barcode text.

code128B.Text = "CODE128B";

//Draw a barcode in the new Page.

code128B.Draw(page, new PointF(25, 500));

//save and close the document

MemoryStream stream = new MemoryStream();




Xamarin.Forms.DependencyService.Get<ISave>().Save("Barcode.pdf", "application/pdf", stream);


Please try this and let us know  if you need any further assistance.




Live Chat Icon For mobile
Up arrow icon