0

I'm able to generate a barcode by using the following code:

    $code = '12345';

Then to generate the barcode, I do the following:

   <barcode code="$code" type="C39" size="0.5" height="2.0" />

However, it is not generating the correct id. Is there something that I'm doing wrong? What I'm using is the mPDF tool, and I can't change to a different pdf tool.

Thank you..

Kevin Davis
  • 367
  • 1
  • 7
  • 25

1 Answers1

3

It's hard to tell what syntax the two code snippets are in, but if that PHP variable needs to be printed in XML you need to specify that it is PHP:

<barcode code="<?php echo $code; ?>" type="C39" size="0.5" height="2.0" />
Matthew R.
  • 4,332
  • 1
  • 24
  • 39