Categories
Uncategorized

PDF to PNGs

Occasionally I need to convert a PDF file to a bunch of PNG files. If you’ve just got one page this is pretty easy to do using Preview.app on macOS. Just open the PDF, export it, choose PNG, choose the desired resolution, and you’re all set. But a multi-page PDF is a bit different, so I’ve got a tool to do it for me.

I’m not going to take much credit for this, as I found the explanation how to do it in some long forgotten forum post and ran with it. It’s basically a macOS Automator Workflow that does all the work. I just packaged it up and tossed it on GitHub as PDF to PNGs

If you find it useful, you’re welcome! If I forgot about it and find this post, congrats to past me!

Categories
Uncategorized

Laser. Cut. Files. (Part IV)

It’s been a few years since I’ve posted about laser cut files, and by that I mean, the files I prepare to be used for laser cutting, so I thought I’d do an update.

Right now I typically use a few different laser cutters in the Milwaukee area. At Milwaukee Makerspace there’s a 60 watt ULS and 50 watt ULS, but using a Windows PC with CorelDraw for control, and at Brown Dog Gadgets there’s a 90 watt Chinese laser cutter using CorelDraw (and LaserCut 5.3) though it seems to be a much newer version than used at the Makerspace. I also use a 40 watt Epilog Zing at UWM’s DCRL. The Zing uses Rhino instead of CorelDraw, which may sound weird, but it works.

I’ve got a file workflow that can work with all of these machines… which I’ll explain below.

Panel Mount

Here’s what my vector art looks like in Inkscape. You’ll notice that the inside lines are blue, and the outside lines are black. This is so we can set a manual cut order for machines that don’t automatically cut inside lines first. (Some software is smart, and always makes inside cuts first, other software… is not.)

lcfiles02

I should note that while doing the design work I may end up with multiple layers. Often I’ll use layers to hold pieces or revisions of a design. For our final file though, we want a single layer.

Let’s pretend my design file is named “Panel Mount.svg”, and it has more than one layer. When I’m happy with my work, and have all the things that will be cut on one layer, I’ll save that file, duplicate it, renaming the dupe to “Panel Mount LC.svg” and then open that file. My original design file (Panel Mount.svg) is now safe and sound, but my new file (Panel Mount LC.svg) is about to get altered.

Files

I usually set all the objects to have no fill. This may not be required for all workflows, but I like to be consistent. (Oh, one more thing… you may need to “convert objects to paths” to get things to work like you expect them to in LaserCut 5.3)

Files

For the stroke I’ll set the outside lines to black… (This may be different depending on your laser cutter software.)

Files

And I’ll set the inside lines to blue. Again, this may depend on the laser cutter software & driver you use. Some allow you to set the order of colors, and some may not. If I need more colors I can use red, green, etc. (Also, if you’re working with a laser cutter operator who is colorblind, ask them what colors they prefer.)

If you want to selectively cut things and only have one color, you can use this trick: Load the file into the laser cutter software (CorelDraw, or whatever) and delete the parts you don’t want to cut, then cut. Then “undo” until all parts are back on the screen, then delete other parts, cut again, and repeat. Not the cleanest method, but it totally works. Don’t move any parts, though you may have to ungroup them, and obviously do not move the thing you are cutting.)

Stroke 0.03mm

Once I’ve applied all the colors, you can select everything and set the stroke. I set it to 0.03mm. This should set it to “hairline” when you import it into CorelDraw. Rhino also seems to do the right thing. If your stroke is too thick it can cause issues. (Always check for the lines to be set to “hairline” after you import your PDF.)

View

After you change the stroke the lines may appear very faint. If you can barely see them switch the Display Mode to “outline” which makes every stroke appear a black and sort of beefs up the lines.

At this point I run down the checklist…

  1. The file has one layer (If it had more, I duped the file and then adjusted the dupe to have just one layer.)
  2. The file has all objects set to no fill.
  3. The file has all objects set to 0.03mm stroke.
  4. The file has different colors for inside and outside cut lines.

Obviously you can do all the file prep stuff (line colors, stroke, etc.) in your master file, and then dupe that one and delete any extra layers. The order isn’t the most important thing here.

PDF Export

Once we’ve made all the changes, we can save our “LC” version of the file. After that, it’s time to use the File menu’s Save a Copy… command to save it as a PDF file. Note that “Convert texts to paths” is selected. This should create a PDF that does not rely on any fonts being installed. If you used text in your file, this is helpful. It does however mean that you cannot edit any text when you import the PDF into other software, as it will have been converted to lines.

PDF

Oh, one more thing! Some older versions of CorelDraw seem to have issues importing PDF files created in Inkscape. On Mac OS X, I just open the PDF that Inkscape created, and export it. It somehow fixes the PDF so CorelDraw likes it. Whatever… it works, so I do it!

Simple Dual Axis Solar Tracker

(BTW, the piece I used an as example was for the Simple Dual Axis Solar Tracker from Brown Dog Gadgets.)

Categories
Uncategorized

Laser. Cut. Files. (Part III)

NOTE: See the latest post on this subject: Laser. Cut. Files. (Part IV)

SVG file in Inkscape
SVG file in Inkscape

After my last post on the subject, Laser. Cut. Files. (Part II), I figured that I had something that worked… but then something came along that worked better!

Thanks to a comment from old pal Thomas Edwards on the Part II post:

Have you tried Inkscape Save as EPS, then Preview EPS to save PDF? (Inkscape Save as PDF might work as well, but I find Corel Draw gets messed up by fonts unless I start as EPS and then go to PDF)

I decided to give PDF files from Inkscape a try. They didn’t work. CorelDraw gets some crazy error trying to open PDF files I create in Inkscape on Mac OS X… but what did work was a two-step process!

Again, my goal is to do all of my design work on Mac OS X, typically using Inkscape, and then moving my files to the Laser Cutter PC running CorelDraw on Windows (yuk!)

PDF file in Preview
PDF file in Preview

So for now, my process is the following:

  1. Create vector art in Inkscape
  2. Save (original) file as an SVG
  3. Save (a copy of the file) as a PDF from Inkscape
  4. Open the PDF from Inkscape in Preview and Save as a PDF
  5. Copy the new PDF file to Laser Cutter PC
  6. Open a new document in CorelDraw and import PDF file

Save as a PDF (again!)
Save as a PDF (again!)

Windows and Linux users, your mileage may vary, and obviously you don’t have Preview.app, but on Mac OS X this process works for me. And as for the note in the comment from Thomas about fonts, I’d be sure to convert any fonts into outlines after I save my SVG file, but before I save my PDF file. (It’s an old print design trick.)

Categories
Uncategorized

Laser. Cut. Files.

Inkscape

NOTE: See the latest post on this subject: Laser. Cut. Files. (Part III)

Update: I made an error in specifying which DXF export I used. I’ve corrected that below.

In my previous post Laser. Cut. Wood. I talked about cutting wood on the laser cutter at Milwaukee Makerspace, and I mentioned I wanted to talk about files… so read on.

The laser cutter can work with raster files or vector files, and since I last year when I got the Egg-Bot and had to dig into using Inkscape, I’ve become fond of that little open source vector drawing application. I’ve used it for 3D printing and for my cucoloris design.

When I started exporting DXF files from Inkscape for use on the CNC Router, Royce mentioned an Inkscape extension called Better DXF, and then Shane found Better Better DXF and then I found Big Blue Saw DXF. These all have their purposes, but for exporting a DXF file for the laser cutter, they were terrible. :(

Oh, before I tried the DXF files, I exported a PDF from Inkscape. I figured that since the PDF from BoxMaker went into CorelDraw without issues, it might be worth a try. No dice. CorelDraw said the PDF was “invalid” and couldn’t open it. Preview.app on Mac OS X had no issues, but since it didn’t work, I’d suggest not trying to generate a PDF from Inkscape to import into CorelDraw. I also tried an EPS file, and a PostScript file from Inkscape, since CorelDraw should have been able to open those. Again, no luck. On to the DXF files!

Here’s the results of my file tests. For each file, I started with the original SVG file of the Milwaukee Makerspace logo in Inkscape, and exported using the corresponding extension:

Format Results
Better DXF The file imported into CorelDraw scaled about 10 times too large.
Better Better DXF The file imported into CorelDraw scaled about 10 times too large.
Big Blue Saw DXF The file imported into CorelDraw scaled about 1/4 the actual size.
Desktop Cutting Plotter DXF The file imported into CorelDraw scaled about 10 times too large.
Autocad DXF The file imported into CorelDraw properly.

For for the first three DXF files, they didn’t work as desired. It appeared as though the curved segments were made into line segments. This would make sense for the CNC Router, as it would save a step in CamBam, but for the laser cutter it just made the curves not be curves. For the fourth one, this this is the one I originally thought worked, but alas, it imported way too big. (I think the lines remained curves though.)

Export DXF

So what worked? The AutoCAD DXF exporter. (Which still made the curves into line segments, so I’m not 100% locked into this, but it worked better than anything else so far.) It actually came in at the right size, which is what I wanted.

My warning for these DXF files are this: Always save your original SVG file! I’ve had hit & miss experiences opening the DXF files, even in Inkscape. YMMV, as I think my loading 3 different DXF extensions has somehow confused Inkscape as to how it wants to open DXF files. (Any advice here would be appreciated!)

Oh, it’s also worth noting that your vector file in Inkscape should have just a very thin stroke on the lines. How thin? 1 pixel, or less. Less than a pixel? Yeah, somehow you can use 0.05 px as a width. I don’t know how… You can also use 0.001 inches. Whatever, just make it thin to be safe. (And in CorelDraw, set your line to hairline to be safe.) This is fairly similar to what I do for the Egg-Bot, since the width of the plotting pen will determine the width of the line drawn, not the stroke of the line on your screen.

CorelDraw

So here’s our logo, which we imported into CorelDraw (successfully) and then added a circle around it, in red. To the upper-left of the circle you can see the darker rectangle outline that indicates the upper-left corner of the laser cutter platen.

I then ran the job with the following settings… Black and red have specific settings that match up to the colors used in your file. I also set them to vector output. (I think that if you set it to vector and your file has only raster data, the laser cutter will just beep at you, and not start the job.)

CorelDraw

Here’s where we go off-script and start experimenting. You may end up tweaking the settings and running the job again, or you might just re-run the job right from the control panel of the laser cutter. When I etched my sign, I ended up just re-running the job from the control panel until I was happy with how it looked. (Obviously you don’t want to removed the piece you are cutting from the machine, as you may not get it back exactly where it was.)

CorelDraw

Now here’s where it gets tricky. I was happy with the etching (which was the black lines in the file) but not the cutting around the edge (which is the red circle in the file.) So what I did was, deleted the black lines, left just the red circle, and then sent the job to the laser cutter again. Then I could keep running it until it cut through the wood, without running anymore etching of the logo.

Now, I don’t claim that this is the best way to do things, or the only way to do things, but these are my notes, as I’m learning, and I’ll keep adding to them, and will refer back to them, and if things get better, I’ll write that up as well. Oh, I’ve also whipped up a little Laser Cutter HOW TO you might find helpful.

I’ve got a few more laser cutter tips & tricks, but I’ll save them for next time…

(See Also: Laser. Cut. Files. (Part II))