OpenOffice::OODoc - How to insert Horizontal Line/Rule in a Page

265 views Asked by At

I am creating ODF Document using OpenOffice::OODoc module. I want to have a Horizontal Line/Rule after a Heading.

I have seen documentation but it has no solution for this problem. I even tried to insert a paragraph with border, but it leaves a vertical white space after top border and next line.

Any idea how can this be done?

1

There are 1 answers

0
Chankey Pathak On

I've noticed that there are two methods--which I'm aware of--to accomplish this task. There's Insert > Horizontal Ruler or by applying a bottom border to the a paragraph.

From what it appears, the "Horizontal Ruler" is just an image inserted in the text. - OpenOffice forum

So I think you could use an image (which contains a line).

$document->createImageStyle
                (
                "NewImageStyle",
                properties      =>
                        {
                        'draw:luminance'        => '20%',
                        'draw:color-inversion'  => 'true'
                        }
                );

$document->createImageElement
                (
                "Image1",
                style           => "NewImageStyle",
                attachment      => $newparagraph,
                import          => "path\to\rule.jpg"
                );