Image Object UPC Symbol work around

Just as I feared, my grocery stores told me my UPC symbols don’t scan. This really hurts as I am ramping up spring time production and don’t have extra time so I need some advice. Pan X does offer an alternative that gives the same (actually better) result. I can use line objects 1 pixel wide, 7 black or white per number to make the symbol and guards in full size. I only use the first 10k number series so the first 7 of 12 numbers never change and Guards never chang and are a template. The idea is to group each 7 bar number and name it for its position and value, eg. 7R0. I need positions 7 thru 12, R0 to R9. I then stack the groups on top of each other. I can select and print each label in a loop and use use text displays with text funnels to display the readable numbers and the objectaction statement to hopefully bring to front the needed number line groups for each UPC position. I can’t find anything in Help that says how to do this.

It’s not possible to modify object Z order (front-to-back order) with a procedure.

I’m not 100% sure I understand what you are trying to do, but if you think that it can be done by modifying the Z order, there are other ways to accomplish this.

One possibility would be to place the objects off to the side somewhere, then use a procedure to swap the objects you need into place. Then swap them back out to the side when done.

However, I think what I would probably do is create the objects on-the-fly as needed using the newformobject statement. You should be able to make a subroutine that takes the position (7 thru 12) and character (R0-R9) as parameters and builds the necessary line objects. If needed, you can manually build each R0-R9, then save it as a blueprint to write the code for you (you could take out most of the code that is not needed for options you aren’t using, but you don’t have to). The only modification you would need to make to the blueprinted code would be to adjust the rectangle for the target position. For each line object, the code will look something like this:

let symbolwidth = 8
newformobject "LineShapeObject",
    "rectangle",rectangletweak(rectanglesize(158, 409, 46, 1),"+x",position*symbolwidth)
    "Tags","UPC Symbol",
    "$LineSlope","Positive",
    "$Stroke","Solid",
    "$HorizontalLine","0"

I’m not sure if the symbol width is actually 8, but you can easily adjust it.

When you’re done with the objects you can quickly delete them, since they have been assigned a tag value.

selectobjects objectinfo("tags") = "UPC Symbol"
deleteselectedobjects

Update - I just looked at the Wikipedia page for UPC codes. I would not use line objects, I think you should use rectangle objects, but the idea is the same. You need only two rectangles per digit, each with a width of 1, 2 or 3.

This table shows the specifications for the two rectangles.

Generating these in code will be super easy, in fact, I think I would probably generate even the fixed numbers in code rather than manually (though take care to note that numbers on the left side use a negated pattern, white and black are reversed).

Wouldn’t it be easier to make use of a UPC font e.g. https://fonts.google.com/specimen/Libre%2BBarcode%2B39 ?

I have suggested that to him in the past, as well as manipulating his images to a higher resolution.

My brain kept processing this question last night in my sleep (which kind of sucked). I now think a different approach would be better. Since there are always 2 bars per digit, I think it would be easier to make all of the bars in advance, and then just reposition them as needed. Give each rectangle object a name like 7a, 7b, 8a, 8b. Then you could have a loop that uses the changeobject statement to shift the bars into place. I would make a state machine driven by an array set up from the UPC encoding table I included in the previous post.

I would think so also. However, the Google font you linked to is not for UPC-A codes, its for Barcode 39, which is different. I have not found a free UPC-A font, though maybe I just didn’t search hard enough.

I found this with a search for “UPC-A font”.

1 Like

I mentioned this before, that I had a pdf that I wanted in the background on a form, and it printed out at 72 dpi., very blurry. So I saved it in Preview as a tif at 360 dpi, embedded it in the background in Panorama and reduced it to 20% size. So then it prints out at the proper size at 360 dpi, which should scan properly.