PDF export + Illustrator

I had some free time, so I decided to do a few quick improvements. Now, it doesn’t matter the order in which you drawn the fill and the stroke, or if you placed something in between. It will also ask you if you want to delete the background (I only did this because I wanted to check how to make a dialog-window with inputs). For now, it suits all my needs, so I don’t think I’ll improve it anytime soon. Have fun!

Hi there!

I would like to share with you another tip. Like in my other post (GPU LUT + Photoshop), this is more oriented for OF beginners, programmers who are not familiar with tools like Illustrator or graphic designers who like to code around (my case also!).

It’s a simple Illustrator sketch that helps you deal with the way openFrameworks draws and saves PDFs. You can get it here. Mind that it is really simple and specific. Read the following, if you will. :wink:

The other day, I was working on this large-format poster:

Let me zoom-in a bit (this is important):

As you can see, this was made with a craaazy amount of circles. Circles with fill and stroke (On the first sketches, the difference between stroke and fill was much notorious, but you can still see it on the final print).

Since I wanted to have full control of those circles, I saved the results from openFrameworks in PDF. The problem was, and Processing does the same thing, you get two circles per “one visual circle”. That is: one with stroke and no fill and another with fill and no stroke.

This is already boring with 20, imagine with thousands and thousands. And thousands. So, I made a simple script to merge the stroked path into the filled path, and remove the first one. It skips the background and only works with all of your objects are drawn with fill and stroke, in that order.

Like I said before, it’s just something I did to solve my specific problem. But it’s enough to get you started, or to, at least, realize that you going to face that issue some day.

If you have any suggestions/corrections, please do so!


Interesting, but have you tried using ofxSvg? When I need to work with oF and Illustrator, I usually bridge them by importing/exporting SVG files though ofxSvg implementation is not perfect.

There a few ofxSVG, to which are you referring? : )

I’ve only used oF-bundled one, but if you have any recommendations I’ll try it :smiley:

The one bundled with OF, only let’s you import SVGs to OF. In this case, I want to export vector graphics from OF and work them in Illustrator. Hence my issue.

These ad-dons (here and here) let you save to SVG. But I haven’t try them, yet.

Mainly because, usually, I prefer PDFs. The reason why is, if I want to send samples to someone who’s not comfortable with vector formats, PDF is a better choice: you have the possibility to merge pages in a document-style file, it’s more OS supported (even Mac OS struggles with some SVGs) and, sometimes, you get a weird object/canvas size relation in SVGs (a small object for a big canvas, even if the canvas is set to match the object.)

Made some improvements, updated on the first post.