Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Horizontal Line By OODoc

by sachss (Sexton)
on Feb 16, 2017 at 02:32 UTC ( #1182115=perlquestion: print w/replies, xml ) Need Help??

sachss has asked for the wisdom of the Perl Monks concerning the following question:

I have the following test code:
#!/usr/bin/perl -w use strict; use OpenOffice::OODoc; use constant FALSE => 0; use constant TRUE => 1; my $doc = odfDocument( file => "MyDocument.odt", create => 'text' ); my $rightStyle = $doc->createStyle( "RightStyle", family => 'paragraph', parent => 'Standard', properties => { '-area' => 'paragraph', 'fo:text-align' => 'right', 'style:font-name' => 'Times New Roman' } ); my $leftStyle = $doc->createStyle( "LeftStyle", family => 'paragraph', parent => 'Standard', properties => { '-area' => 'paragraph', 'fo:text-align' => 'left', 'style:font-name' => 'Times New Roman' } ); $doc->appendParagraph( text => "RightStyle-Applied", style => "RightStyle" ); $doc->appendParagraph( text => "LeftStyle-Applied", style => "LeftStyle" ); $doc->appendParagraph( text => "\n\nThis is a test\n------\n", style => "LeftStyle" ); $doc->save; exit 0; ### End of Main ### ### -- Begin of Subroutines --- ### ### -- End of Subroutines --- ### ###--- End of File ---###

The \n------\n is what I manually to do create a horizontal line within OpenOffice Writer. But when I run the above code, I just get the "------" on its own line and not a horizontal line.

Anyone have any ideas?

Replies are listed 'Best First'.
Re: Horizontal Line By OODoc
by vr (Curate) on Feb 16, 2017 at 11:05 UTC
    The \n------\n is what I manually to do create a horizontal line within OpenOffice Writer.

    This auto-formatting is GUI enhancement. Try, instead, adding "fo:border-bottom" to paragraph style. I don't have this module installed, can only guess.

      I tried "fo:border-bottom", and it's not the same.

      The horizontal line was between the lines. This is under a paragraph. Not sure how to apply something to a single line.

      Any other ideas?

        My bad, paragraph border is what the "\n______\n" gets replaced with, while they are hyphens, not underscores, in your question. The "\n------\n" is not auto-replaced in my (too old?) OO.

        So another guess: try style:text-underline-style or similar in linked documentation (probably it's "Underlining" in Character Style in GUI, you are looking for).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1182115]
Approved by stevieb
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2022-06-30 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (98 votes). Check out past polls.

    Notices?