true stories from the interpreter


Moving Sucks, PDF Generation Can Also, and Air Conditioners Should Blow

Moving and AC

So moving this weekend wasn't fun. It was the polar opposite of fun. But it's basically over. I still need to get a few things, like a table and wall decorations. And I still need to actually put stuff away instead of having it heaped in a pile next to my bed. I've been here for less than a week and my AC has broken twice. AC current state == Broken. So not cool, literally.

PDF Generation

So I found this nifty tool called htmldoc which can convert HTML to PDF. From what I've been told, generating HTML and then converting that to PDF is an accepted (and easy) method of generating PDF documents. I spent a few hours writing code that generated HTML (with CSS) for each question type and for the quiz overall. Viola! Dynamic HTML for quizzes. A quick call to htmldoc and... Wait, that doesn't look right. After a little searching I found out that the current version of htmldoc does not support CSS yet. Well, there goes that plan.

So I started reading reportlab documentation. Hours of tinkering and tweaking later, I have PDF generation support. I'm sure the layout needs to (and will be) tweaked as development goes along, but it works for now. I created an example quiz and generated the PDF for it.

That's my quick update for today. Now I'm off to lunch and then back to work.



Post a Comment

<< Home