2D barcode font for AutoCAD

2D barcode font for AutoCAD

caddude1
Collaborator Collaborator
698 Views
14 Replies
Message 1 of 15

2D barcode font for AutoCAD

caddude1
Collaborator
Collaborator

I am looking for a resource with a 2D barcode scanner font, which I can use with AutoCAD. My requirement is for repeatably sized and spaced images of a series of numbers for an optical scanner. I can create (in Adobe) the PDF file; however, the sizing and spacing of imported images (GIF files) become a challenge. The spacing is a critical point, as the product is positioning an AGV in a plant environment.

Mark Behrens
Controls Designer/CAD Manager
42 year AutoCAD user | 15 year AutoCAD Electrical user
0 Likes
699 Views
14 Replies
Replies (14)
Message 2 of 15

pendean
Community Legend
Community Legend
0 Likes
Message 3 of 15

caddude1
Collaborator
Collaborator

Thank you for the link @pendean. I am not looking for a barcode for a DWG file. I am looking for a barcode font to use within a drawing, which will create a 2D code for a numerical value. I have a series of codes that need to be read by a scanner to determine the position of an AGV and fed back for internal processing. 

Mark Behrens
Controls Designer/CAD Manager
42 year AutoCAD user | 15 year AutoCAD Electrical user
0 Likes
Message 4 of 15

DGCSCAD
Collaborator
Collaborator

This one works for what I've used:

 

LibreBarcode39-Regular.ttf

 

Edit: Keep in mind you'll need a * as a prefix and suffix, as in:

 

*12345*

 

AutoCad 2018 (full)
Win 11 Pro
Message 5 of 15

apotterSJHGL
Observer
Observer

I think what we are looking for a data matrix code, not a 2d bar code.

0 Likes
Message 6 of 15

caddude1
Collaborator
Collaborator

Correct, Andrew. I misspoke on the original e-mail.

Mark Behrens
Controls Designer/CAD Manager
42 year AutoCAD user | 15 year AutoCAD Electrical user
0 Likes
Message 7 of 15

paullimapa
Mentor
Mentor

After creating the PDF from Adobe, just use AutoCAD's PDFAttach command to place the PDF into your drawing at a scale of 1.

https://help.autodesk.com/view/ACD/2026/ENU/?guid=GUID-77D6192C-925B-46A3-8717-240702ED5715 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 8 of 15

caddude1
Collaborator
Collaborator

@paullimapa I have done so, with success in generating the drawing. My challenge is that AutoCAD puts a complete border around the image. The scanner software fails when it sees the border around the open areas of a matrix. See the attached screen grab.

Mark Behrens
Controls Designer/CAD Manager
42 year AutoCAD user | 15 year AutoCAD Electrical user
0 Likes
Message 9 of 15

paullimapa
Mentor
Mentor
0 Likes
Message 10 of 15

caddude1
Collaborator
Collaborator

@paullimapa That was the first option I tried. I am using AutoCAD Electrical, so that may have something to do with it also. I have tried setting the value to 2 as well with the same result in the plotted drawing. The value that I set the variable to does not affect the drawing. I have found this in multiple files I created to test it out. The attached image is a newly created file, with the value set to "0" as the command line shows.

Mark Behrens
Controls Designer/CAD Manager
42 year AutoCAD user | 15 year AutoCAD Electrical user
0 Likes
Message 11 of 15

TheCADnoob
Mentor
Mentor

My recommendation would be just to get the geometry into AutoCAD natively. 

 

We have a proprietary way of generating QR codes that output as SVG. That said, there are lots of online places that can generate QR codes and output them as svg. 

edit: you can use quickchart.io

URL > https://quickchart.io/qr?text=yourtexthere&format=svg

 

From there, I put it in a third-party application to convert it to dxf. (I use Inkscape, but anything that can convert svg to dxf should work)

 

Then once its in DXF, I just copy it into the drawing. 

 

It should be noted that our SVG only outputs line segments. So when it first comes in its polylines with no width, so i have to do one extra step of applying a line width to the imported dxf lines. 

 

TheCADnoob_0-1760389715751.png

 

 

before adding width

TheCADnoob_1-1760390080213.png

 

 

CADnoob

EESignature

0 Likes
Message 12 of 15

paullimapa
Mentor
Mentor

That’s odd. Could you share your pdf?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 13 of 15

caddude1
Collaborator
Collaborator

Here is the PDF, SIr. thank you for your time and effort in helping me. 

Mark Behrens
Controls Designer/CAD Manager
42 year AutoCAD user | 15 year AutoCAD Electrical user
0 Likes
Message 14 of 15

leeminardi
Mentor
Mentor

Regarding the border,  how about adding a polyline to cover the border?  Set its width to a small value (e.g., 0.1) and its RGB color to  255,255,255.

leeminardi_0-1760451871712.png

This prints as:

leeminardi_1-1760451939779.png

 

 

lee.minardi
0 Likes
Message 15 of 15

paullimapa
Mentor
Mentor

I'm using plain AutoCAD 2021 and the PDFFRAME setting is behaving as documented.

The only time the printed pdf shows a frame around the barcode is when PDFFRAME is set to 1

See screenshots & attached dwg & pdfs

paullimapa_3-1760462887610.pngpaullimapa_4-1760462901155.pngpaullimapa_5-1760462916727.png

paullimapa_6-1760462954008.pngpaullimapa_7-1760462976240.pngpaullimapa_8-1760462997352.png

paullimapa_9-1760463380997.png

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes