#!/usr/bin/perl # example4 - Creates a sxw Writer document 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 4"); # Title of document $doc->oooSet("subject", "Subject - Example 4"); # 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($i = 1; $i <= 9; $i++) { $doc->oooData("h${i}", "Heading $i"); } $doc->oooData("textbody", "The lazy fox jumped over the laying log. The log sat under the jumping fox.\nThe lazy fox jumped over the laying log. The log sat under the jumping fox.\nThe lazy fox jumped over the laying log. The log sat under the jumping fox."); $filename = $doc->oooGenerate("example4"); # Create the document print "$filename\n"; exit;