PDF Generation and emailing attachements with Ruby on Rails

Rails, Ruby

So I’m working on a <omitted> system for this company. They need <omitted>.

So we get CSV <omitted> data and need it to be user uploaded and put in the database.

Then we need it to generate reports for how much each <omitted> assigned to them.

We also have to tell <omitted> how much business they generated on the <omitted> we assign to them for a given campaign.

So we take the <omitted> data <omitted>  upload it – we have to GeoCode some of the data b/c some <omitted> b/c the <omitted>get commish on their sales.

So we upload. Then we have to generate weekly and monthly reports as PDFs, email them, and save them. They also want some sort of verification system too.

Any way I’m using PDF::Writer to get the PDF’s made. Its not too hard but I have to double the code I did for the simple HTML reports (this was coded mostly in the view ewww…I know this is a shitty way to do it but there were some challenges I couldn’t get around like for an <omitted> then added and totaled for the month then totalled for all the business they did ewww gross).

Anyway I don’t like PDF::Writer b/c I cant figure out how to color plain text. Maybe its a simple trick but I can’t figure it out even after reading the API 12 times.

So I got one report to generate and save itself to the filesystem. Cool. Now for email…I should go figure that out then post what I got out of it.

I used a good PDF::Writer tutorial to get me started

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s