Apache FOP: formatting objects is fun

I’ve been working on a tricky problem at work this week (and last week as well actually, its been really really tricky in fact), we need to be able to output a form in both PDF (Portable Document Format) and PCL (Printer Control Language) output, because our fax system can only handle PCL format.

Ghostscript

I had a look at using Ghostscript, its been around a while and is widely-used, freely-available and, by all accounts, stable. I had some trouble getting it working initially but I think it would have done the job.

Apache FOP

The Apache Project has a project called FOP (Formatting Objects Project) which is part of their XML Graphics project. Its a module that takes a particular type of XML format called Formatting Objects (now a w3c recommendation and known as xml:fo), a type of XML used to represent a document of information along with information about presentation.

Since xml:fo is a recognised standard, its a great format to choose to implement the conversions to PCL and PDF. Other output versions are also available with more on the way too, so its an application that can be adapted to meet other needs as they arise.

XSL translations

Since xml:fo is a standard and its XML, it should be possible to get any number of XML formats (including Open Office or Word XML) translated into it using an XSL (eXtensible Stylesheet Language). I tried out a couple of these from http://www.antennahouse.com/, however although these worked well with the sample files I found that I had trouble with the resulting xml:fo formats produced from my own xhtml files.

AntennaHouse clearly have a lot of knowledge in this area though, and their site is well worth a visit for background reading on this topic. I suspect that part of the problem was that FOP only has a partial implementation of the xml:fo specification, so although I was feeding it valid xml:fo, it didn’t know what to do with all of it. There is a rewrite in progress so I expect that newer versions will be much more robust.

Final Solution

In the end (since I only wanted a simple one-page form), I settled on writing the xml:fo format by hand, producing really great results in both formats and with images as well. I’ve also been asked to look into programs to generate this output, they’re mostly commercial but if I come across anything interesting I’ll add it here. Apache FOP is a great project and I hope it doesn’t lose it momentum!

The Wool Shop

I have recently moved to Leeds and am slowly starting to find my way around and build up some local knowledge. A very important ingredient in this process is my discovery that there is a great wool shop near where I live. Its so good in fact, that I have to recommend it to anyone who likes wool (or old-fashioned shops!).

The shop is at:

S & D Woodhead
Wool Shop, Wingate Junction, Tong Road, Leeds, West Yorkshire LS12 4NQ
Tel: 0113 263 8383

From the outside it looks quite big, however when you go in the shop part is really small. You have to have a chat with the lady behind the counter about what you want and she will disappear off and come back with some suggestions. There are big sacks of discounted wool, often just a couple of balls, and everyone is welcome to rummage (but be warned that you will get filthy in the process!)

I wasn’t sure what I was looking for and got some good advice while I was there as well as some very patient service. I discovered that they don’t take cards and I didn’t have a lot of cash on me (I’m 25, my generation lives by plastic!), I was sold enough material to start the project and the rest has been put aside with my name of for me to collect when I need it – and by that time I’ll have a good idea of how much of each type of yarn I’ll need as well.

Knitted Scarf/Wrap

I’ve knitted a scarf! This is news because I although I like crochet and learned to knit as a child, I’m really not a very good knitter. This pattern was hardly knitting though. Its made with silly wool (Sirdar Frizz) and knitted on broom handles! OK so actually they were 20mm knitting needles, but broom handles would have done just as well.

Each row is thirty stitches and its all “knit”. It is so quick to knit up, because the stitches are so big! Its a multipurpose garmet which can be worn as a scarf or as a wrap, I’ve tried to photograph it a few different ways but you still don’t get a real sense of how drapey and soft it is!

scarf wrap

closeup

The idea came from a pattern in the Simply Knitting magazine, although I didn’t use the suggested yarn. Mine had bigger “bits” hanging off it and as a result of that or my tension, I needed three balls of Fizz to make the scarf. The final result measures 68 inches on scarf setting and about 29 inches by 46 in wrap mode.

200 crochet blocks

I have a new crochet book! My mum had an “I saw this and thought of you” moment, and bought me this:

200 Crochet Blocks for Blankets, Throws and Afghans

Its a good book with a variety of different blocks (although some of the 200 are the same pattern but with stripes, but I suppose they had to get them from somewhere). The best thing about the book is that in the contents page where it lists the blocks with their names and page numbers, there is also a little picture of the block itself, so you can see what it looks like and easily find one you are looking for.

So far I’ve managed four blocks to make a cushion cover when they are sewn together:

dahlia framed_flower peach_rose waterlilly

All the blocks are made in double-knitting wool with a 5mm hook. Mine came out at 8 inches each but the books says 6. At least they are all the same size, but as you can see from the pictures, they’re not all wonderfully square! Still I think they’ll be OK once they are all sewn together and backed … will post a photo of the finished project when it is finished.

Crooks and Hooks

Well, just hooks actually! I’ve been wondering for a while where those photos of beautiful crochet hooks come from in the front of all the crochet books … they’re colourful and I want some.

After a bit of hunting around I discovered that these are Susan Bates hooks, and they are widely available in North America. I’m in the UK and couldn’t find anyone who would ship the hooks to Europe. To cut a long story short, ebay came up trumps and I found a store that would ship two sets of hooks to me for $7 after I emailed them and explained the situation – so thanks to Corona Quilts as I now have beautiful colourful hooks :) Here they are

photo of my colourful crochet hooks

Ringing the (password) changes

I have milestones in my working life, I mark time by them. They help me to think quantitively about how much time has passed since a particular point in time or event. Its helpful because it enables me to think clearly about whether a colleague would have been involved in a particular activity at that particular time. And the nature of the milestone? Password changes!

I am pretty consciencious about passwords. I always have different ones for different things, with uppercase, numbers, punctuation and sometimes uppercase. As a sufferer of DOuble-CApital-itis, I am not a big fan of uppercase but I make the effort sometimes. Of course there are exceptions, such as the one password I use for all random website registrations, but I’m in good company with that. Because of these password habits, changing a password that I use every day is a big event! I have to think of something that my brain can hold on to, and train myself to type the new one rather than the old. I sometimes change existing passwords for no reason, I just think its good practice. What I really hate is being forced to use a password I don’t want, or change it when I am not ready!

I have recently changed employment, no particular reason just the next step on the ladder really. At my old workplace, I typed my password every single time I opened an internet browser, or logged onto another machine. I can’t deal with too many windows on the taskbar so I was opening and closing browsers all day. I must have typed it fifty times most days. The password complexity rules were there, but they didn’t really get in my way. I was forced by the system to change my password every three months. Three months is quite short when you are subconsciously typing that same password in so often! Still, the password change would roll around, marking a change in season, and I’d spend three days swearing at having typed in the wrong password on autopilot. When my password expired with a week of my notice still left to work, my boss (I guess tired of all that swearing) extended the expiry period to save me the pain.

So here I am, bright and enthusiastic in my new job. Day one, I have to choose a new password. No problem. Four weeks later, I get prompted to change my password. OK, well that’s a pain because I find password changes difficult but hey, I’m new, and I’ll just grin and bear it – after all, I don’t have to type my password for the web proxy here, just when I log in or unlock my machine. That’s still quite a few times though as I don’t leave my desk to go anywhere without locking it. So …. you can guess what’s coming next. Eight weeks into the new job and the password change box is back. My mind is too full to manage another “good” password so I try out something insecure – all lower case characters. And it accepts.

There’s something about this “security” which bothers me immensely. Most password setup systems come with tickboxes, to turn on “features”, such as

  • require mixed case
  • require at least one number
  • require some punctuation
  • ban password recycling
  • ban similar passwords
  • force password change

The sysadmin starts to read the list, tick the top few boxes, decides this is a Good Thing and ticks them all – the system is as secure as possible – Right???

This is how security myths start, and “force password change” is not something where (more often == better). A few months from now, I’m going to be a gibbering wreck, with my plain text password post-it-ed onto my monitor, and not locking the console when I walk away.