#!/usr/bin/perl # example8 - Creates a sxw Writer document with sizes colors use ooolib; # Set variables $doc = new ooolib("sxw"); # Type of document (ie. sxc) $doc->oooSet("builddir", "."); # Directory to create document in $doc->oooSet("title", "Title - Example 8"); # Title of document $doc->oooSet("subject", "Subject - Example 8"); # Subject of document $doc->oooSet("comments", "Who needs comments?"); # Comments for document $doc->oooSet("keyword", "keyword1"); # Add a keyword for the document $doc->oooSet("keyword", "keyword2"); # Add a keyword for the document $doc->oooSet("author", "John Doe"); # Set the author of the document for($size = 6; $size <= 96; $size+=2) { $red = $size * 2; $blue = 256 - $red; $color = sprintf("%02X99%02X", $red, $blue); $doc->oooSet("text-color", $color); $doc->oooSet("text-size", $size); $doc->oooData("default", "ABC"); } $filename = $doc->oooGenerate("example8"); # Create the document print "$filename\n"; exit;