Jump to content

code 128 - modified


Ryan Graybeal

Recommended Posts

Hi everyone.

 

Is there any way to change the width of the bars in a barcode?

 

I have a barcode (code 128) that needs to be 1.75 inches wide and .25 inches high.

 

sample data: 0000000Y

 

I basically need a bold version of the FPD font. I can expand the barcode in the paragraph settings but I can't make the bars themselves any wider.

 

Am I stuck? Or is there a way to modify the standard look of the barcode?

 

Thanks for any help.

 

Ryan Graybeal

FPD 5.1

Mac -> 10.4.10

Link to comment
Share on other sites

Hi Ryan,

 

There are a couple of different ways to change the width of the bars in the barcode.

 

The simplest is to just use a different font and pointsize. For instance, compare the two lines output from this rule:

 
var BarcodeData = NormalizeEntities(Make128Barcode("0000000Y"));
return '<z newsize=20><f name="IDAutomationC128M">' + BarcodeData +
       '<br>\n' +
       '<z newsize=10><f name="IDAutomationC128L">' + BarcodeData;

The first line uses the medium height font in a larger pointsize, while the second uses the large height font in a smaller pointsize. The result is that they both appear about the same height, but the second line has narrower bars.

 

Another way to change the width of the bars is the same way you would change the width of any other text, with either <setwidth newsize=xxx> or <magnify type=setwidth factor=xxx> tags. For instance:

 
var BarcodeData = NormalizeEntities(Make128Barcode("0000000Y"));
return '<z newsize=20><f name="IDAutomationC128M">' + BarcodeData +
       '<br>\n' +
       '<setwidth newsize=10>' + BarcodeData +
       '<br>\n' +
       '<z newsize=10><f name="IDAutomationC128L">' + BarcodeData +
       '<br>\n' +
       '<magnify type=setwidth factor=200>' + BarcodeData;

You'll notice this achieves almost exactly the same effect with the <setwidth> tag as changing the font and pointsize did in the earlier example. And then it uses the <magnify> tag to achieve a similar effect.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...