Jump to content

Horizontal scaling a barcode

Recommended Posts

I'm having a difficulty with our IMB barcode. I finally got resolved the issue with using the font, but now we're having another issue with the length. The Post Office requires the barcode to be at a certain length and height. By setting the point size at 10 we meet the height requirement, but now we have a short barcode. Is there a way to stretch it out to meet our length requirement? I've tried using copyfitline and tracking, but those don't seem to work in conjunction with the makeonecodebarcode.


This is the code we are using to generate our barcode:


var imb = Field("ONECODE");
return MakeOneCodeBarcode(imb.substr(0,20),imb.substr(20) ,10);

Edited by DavisDirectPrepress
Link to comment
Share on other sites

Try this:

var imb = Field("ONECODE");
return '<magnify type="setwidth" factor="150">' +
       MakeOneCodeBarcode(imb.substr(0,20), imb.substr(20), 10);

You can change the value in the <magnify> tag to get the results you want.



var imb = Field("ONECODE");
return '<f name="IDAutomation4State"><z newsize="10"><setwidth newsize="15">' +
                new OneCodeBarcode().Encode(imb.substr(0,20), imb.substr(20));

Here you can change the value in the <setwidth> tag relative to the pointsize (the <z> tag) to get the results you want.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...