+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Cairo;
+
+my $u = 72/4;
+my $s = Cairo::PdfSurface->create('digit.pdf', 7*$u, 7*$u);
+my $c = Cairo::Context->create($s);
+my $n = 0;
+
+$c->set_line_width(2);
+$c->set_line_cap('round');
+$c->set_source_rgb(0, 0, 0);
+
+while (<>) {
+ s/^@@ // or next;
+ chomp;
+ my @r = split /\s+/;
+ @r == 5 or next;
+
+ for my $r (@r) {
+ my ($x1,$y1,$x2,$y2) = $r =~ /^\((\d+),(\d+)\)-\((\d+),(\d+)\)$/ or die;
+ $c->move_to((.9*$x1+.1*$x2)*$u, (.9*$y1+.1*$y2)*$u);
+ $c->line_to((.9*$x2+.1*$x1)*$u, (.9*$y2+.1*$y1)*$u);
+ $c->stroke;
+ }
+
+ $c->show_page;
+ $n++;
+}
+
+print "Output $n pages.\n";