use OpenOffice::OODoc; # Set variables my $testfile = "test"; my $archive = odfContainer($testfile, create => 'text'); my $title = "OpenOffice::OODoc test document"; # Opening the content using OpenOffice::OODoc::Document my $doc = odfConnector ( container => $archive, part => 'content', readable_XML => 'true' ) or die "# Unable to find a regular document content\n"; my $styles = odfConnector ( container => $archive, part => 'styles', readable_XML => 'true' ) or die "# Unable to get the styles\n"; ### read input file and write to OO text document $inputfile = @ARGV[0]; open (INP, $inputfile); $c=0; while () { @line = split (/\t/, $_); if ( @line[14]=~/[a-z]/ & $c!=0 ) { @line[11]=~s/\n//g; @line[12]=~s/\n//g; @line[13]=~s/\n//g; @line[14]=~s/\n//g; # Appending a level 1 heading $doc->appendHeading ( text => "@line[11]\n", level => "1", style => "Heading_20_1" ); # Appending a level 2 heading $doc->appendHeading ( text => "@line[12]\n", level => "2", style => "Heading_14_1" ); # Appending a level 2 heading $doc->appendHeading ( text => "\n", level => "2", style => "Heading_14_1" ); # Appending a level 3 heading $doc->appendHeading ( text => "@line[13]\n", level => "3", style => "Heading_10_1" ); $doc->appendHeading ( text => "\n", level => "3", style => "Heading_10_1" ); $styles->createStyle ( "Colour", family => 'paragraph', parent => 'Standard', properties => { -area => 'paragraph', 'fo:text-align' => 'justify' } ); if ($doc->isOpenDocument) { $styles->styleProperties ("Colour", -area => 'text'); } my $pg = $doc->appendParagraph(text => "@line[14]\n", style => "Colour" ); print "@line[14]\n"; } $c++; ### setPageBreak; aber wie? } # Saving the $testfile file print "Saving $testfile file\n"; $archive->save;