pdf2gerb - convert PDF to Gerber and drill formats

Hi folks,

Last month I designed my first PCB, and I did it in Adobe Illustrator – I use Mac OS X, I wanted to do the layout by hand, and I love Illustrator’s vector design tools. I got stuck, though, when I wanted to use BatchPCB for manufacturing… I hadn’t realized that I needed the design in Gerber format!

I almost did the DIY toner-transfer method and just etched the board at home, but I ended up writing a Perl script to convert PDF files to Gerber and NC Drill format. I’m posting this in case someone else runs into a similar situation, or would rather create a PDF than purchase and learn a CAD app.

If you’re interested in giving the script a try, it’s called pdf2gerb and you can find it [here.

I’m happy to say that BatchPCB did an admirable job with the output from my script. Kudos to David, Sallie and the crew!](Wordpress blog)

I assume the PDF has to be 1:1 scale?

-Bill

That’s correct.

Last month I designed my first PCB, and I did it in Adobe Illustrator

Dude, that’s insane. EAGLE isn’t that bad. :smiley:

Actually, I really enjoyed laying the board out by hand, first on paper (to figure out non-overlapping routes) and then in Illustrator. There’s definitely an art to it!

For me, working in Illustrator is like drawing with pen and paper – so it was a natural choice to get the design into the computer quickly and easily.

Next, open a Terminal window, navigate to the desktop folder, and type ‘chmod 755 pdf2gerb.pl’ to mark it as an executable file.

Can you explain this to me???

Sure thing, Jaime. Go to your Applications folder - generally you get there by clicking on the blue Finder icon in the dock, then clicking on the Applications icon in the left side of the Finder window.

Scroll down through the list of Applications until you find the Utilities folder. Click on it - inside you’ll find the Terminal application. Double-click on it.

In Terminal, type “cd Desktop” (without the quotes) and hit Enter.

Type “chmod 755 pdf2gerb.pl” (again without the quotes) and hit Enter.

I can’t get it to work, it just runs and doesn’t produce any output. I’ve tried both PERL for Windows and Cygwin.

Leon

Leon, the script is only known to work on Mac OS X. I haven’t tested it elsewhere.

(Have you tried modifying the path separator characters in the script – from / to \ ?)

Is that here?

$pdfFilePath =~ /^(.+)/.+$/;

I get lots of errors when I change it to … +$.

Leon

It would probably look something like this… I believe you’ll need to use ‘\’ to represent the '' character, so that Perl doesn’t think you’re escaping a character.

Calculate the output dir from the input file path

$pdfFilePath =~ /^(.+)\.+$/;

Quick hack to handle cwd is same dir as output dir

if ($1 eq “”)

{

$outputDir = cwd() . “\”;

}

else

{

$outputDir = $1 . “\”;

}

Note that while I’m happy to take a guess now and again, per the project page I really can’t provide in-depth support here.

No, that doesn’t work. I’ll have to find my PERL book.

Leon

You might run it in the debugger - ‘perl -d ’. I’ve found it useful during my investigations

It didn’t work for my drawing in pdf form. However, i found out that there are differences between your sample pdf file and my one. In the preferences,

my pdf file:

Adobe PDF Library 9.9 (producer)

Adobe InDesign CS5 (7.0.4) (creator)

PDF-1.3 (type)

191 × 221 mm (paper size)

your sample:

Adobe PDF library 7.77 (producer)

Adobe Illustrator CS2

PDF-1.3

US Letter, Yatay (279 × 216 mm)

I think that because of these differences i cannot produce the same output with you. So is there anythin to solve this ?