I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-01-16 20:39:04-08 by bob
Setting an image anchor type
I would like an image to be anchored to a paragraph.
The xml that does it looks like this:
<draw:image draw:style-name="fr2" draw:name="PainDiagram" text:anchor-type="paragraph" svg:x="4.7327inch" svg:y="0.1882inch" svg:width="1.5744inch" svg:height="2.3618inch" draw:z-index="2" xlink:href="#Pictures/100000000000026900000320E06B0F98.jpg" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"><svg:desc> Pain Diagram</svg:desc> </draw:image>
Is there a way to insert:
text:anchor-type="paragraph"
into the draw:image section of the xml ?

Thanks.
Bob
Direct Responses: 4058 | Write a response
Posted on 2007-01-16 22:33:28-08 by jeunice in response to 4057
Re: Setting an image anchor type
In such situations, I find myself often dropping down to pure XML::Twig. In this case, that'd be something like $element->set_att('text:anchor-type' => 'paragraph'), where $element points to the <draw:image ... /> element.
Direct Responses: 4067 | 4074 | Write a response
Posted on 2007-01-17 16:45:22-08 by bob in response to 4058
Re: Setting an image anchor type
Thanks jeunice, I'll give that a try.
Direct Responses: Write a response
Posted on 2007-01-17 22:48:25-08 by bob in response to 4058
Re: Setting an image anchor type
This worked:
@image_elements=$content->selectElements('//draw:image','Pain Diagram'); my $image_element=shift @image_elements; if ($image_element) { my %attr=('text:anchor-type','paragraph'); $content->setAttributes($image_element,%attr); }
Thanks again.
Direct Responses: Write a response