Home | Puzzles | BlockParty | Crosswords | DominoTile | Fortunes | GameOfLife | Sudoku

Here you can upload a 15x15 crossword in either the Across Lite BINARY (.puz) format or in the pre-v2 Across Lite TEXT format, and a small (approx. 3K) PDF version of it will be created with the look of an archived cryptic crossword from the Sydney Morning Herald.

Check that the answer lengths given in parentheses at the end of each clue are correct.
Create a second PDF file that's the same as the first except that the grid is filled out with the answers.
Don't wrap the clue text after hyphens, e.g. the clues in the SMH puzzles only wrap at whitespace.

Here's a sample input file: MadhavCrypticNoAnswers.txt. Your browser may get confused by the <TITLE> tag and thus not display the contents of the file (e.g. if you're using Internet Explorer), but you can use your browser's View Source feature or download the file and open it with a text editor. And here's the corresponding output file: MadhavCryptic.pdf.

The Code
makegrid.c
helvetica.h
helvetica-bold.h
times-roman.h
gcc -o makegrid -O2 makegrid.c The makegrid program reads the uploaded file and generates the PDF commands to draw the grid and text. These commands are written to stdout. The CGI script makepdf.cgi redirects this output to stream.txt.
pdf_make.c gcc -o pdf_make -O2 pdf_make.c The pdf_make program uses a PDF template and the compressed output (stream.7) generated by makegrid and zpipe to create the final PDF document.
pdf_read.c g++ -o pdf_read -O2 pdf_read.c pdf_read is a PDF parser that I wrote to view the raw contents of PDF files, extract stream objects, and generate the PDF template used by pdf_make.
zpipe.c cd zlib-1.2.3
gcc -o zpipe -O2 examples/zpipe.c libz.a
zpipe is a program that comes with the zlib distribution. See zlib.net and the zlib usage example. I use it to compress the output from makegrid like so:

zpipe < stream.txt > stream.7

References
Adobe's PDF Specification (I used the 5th edition, version 1.6)
Wikipedia's PDF article
Adobe Type Technology Overview — This links to the Adobe Font Technical Notes page which in turn links to the font metrics for the 14 core PDF fonts.
Adobe Glyph List (see also Adobe's Unicode and Glyph Names page)
Windows Code Page 1252 (Latin 1), also known as Windows ANSI Encoding