You are not logged in.

#1 2009-03-12 02:08:03

jaem
Member
From: Canada
Registered: 2009-01-24
Posts: 23

Automating the printing of calendars

Hello all,
I found out about the http://pocketmod.com/ site a while ago, and was interested in using their daytimer idea, however, the online generator was too limited for what I want to use it for.  There is a shell script that can put together a pocketmod daytimer from individual pages, but the content itself is proving to be the problem.  What I would like to set up is a system in which, every week (say, Sunday night), a cron job will run, which will "print" the appointments from my calendar, one page for each day, to individual PDFs, with my todo list in an eighth file, then run them through the pocketmod script, and finally print off a hardcopy.
The main problem I'm having is that I'm not aware of an easy way to pull the day's appointments from an *.ics calendar file, to create a timesheet for that day.  I'd ideally like something that can be done with scripting, although the least complex solution is preferred.  My todo list is currently handled by KAddressbook, and I haven't looked into how that is stored yet, but if anyone knows off the top of their head, I wouldn't mind a pointer.  I have searched for information on this, but short of reading through the ICS format spec and writing my own parser (which I'd rather not do), I'm at a loss.  I will admit that I have only been looking for ways to do this from a script (my initial intention), so I may have missed something obvious.

Any suggestions would be appreciated.


-Jeffery

Offline

#2 2009-03-12 02:47:29

Ghost1227
Forum Fellow
From: Omaha, NE, USA
Registered: 2008-04-21
Posts: 1,422
Website

Re: Automating the printing of calendars

I don't know anything about KAddressbox, since I don't use KDE. However, I'll do a bit of research. The main reason I'm replying is that I hadn't seen pocketmod before, and it's great! Got anything else useful to pass on?


.:[My Blog] || [My GitHub]:.

Offline

#3 2009-03-12 18:21:00

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Re: Automating the printing of calendars

Since you said KCalendar uses ICS files I'm hoping it uses the same format as iCalendar.  Since iCalendar is pretty popular there are a number of parsers already created in a few languages.  Perl is my favorite language and I've already seen a bunch of parses on CPAN like Data::ICal and iCal::Parser.  I found at least one Python parser.  Google around for your preferred language.

I know perl has a few PDF editing modules, I have used PDF::Reuse myself which is pretty simple and fast.  I'll bet python has some, as well.  With PDF::Reuse I read in a PDF file as a simple template and printed text on top of it.  This was tedious, finding the coordinates and such, but was straightforward.  Or maybe there is another way you can find to get it to PDF.

Hopefully ICS is what I think it is and KCalendar follows the standard close enough.  If so, parsing could be alot easier than printing to PDF.

Offline

#4 2009-03-12 18:57:40

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Automating the printing of calendars

As juster suggested, perl has modules available for working with ICS files. I'd go with that

Offline

Board footer

Powered by FluxBB