I did try that, but the EPS function in the FPDF_EPS extension choked on the EPS that came out of Gbarcode. I poked around a bit but don’t know raw PDF or EPS enough to find out what’s wrong. It usually was OK with the first few lines of the EPS but died later on — if I find the time, I can perhaps reproduce the error.

A second problem was that in a RoR environment, dealing with pipes to read the EPS content into a variable would often lead to unexplainable I/O errors. Sometimes it worked for hours, then it failed on every fifth try, perhaps on the seventh, then it worked again. We spent a day trying to locate the error but couldn’t really figure it out.

I thought a solution that is completely PDF and in-memory would be quite sexy, and since Gbarcode offers access to the widths of the barcode, it’s quite trivial to implement. We needed a solution fast, and this seems to work elegantly. The barcode problem will come up again for us in a few months though, if I’m allowed to work on it some more, it would definitely make sense to work out the FPDF_EPS issues. I can’t guess whether they are in the generated EPS or in the extension.