Ben bir başlık ve bir resim ile bir odf-belge oluşturur Aşağıdaki kodu:OpenOffice :: OODoc ile bir resme metin başlığı nasıl eklenir?
#!/usr/bin/perl
use strict;
use warnings;
use OpenOffice::OODoc;
my $doc = odfDocument(
file => 'test.odt',
create => 'text'
);
my $head = $doc->appendHeading(
text => "This is a Test",
style => 'Heading 1'
);
my $style = $doc->createImageStyle("Photo");
my $image = $doc->createImageElement(
'some picture',
style => 'Photo',
attachment => $head,
size => '4cm, 12cm',
link => '/full/path/to/picture.png'
);
$doc->save();
nasıl resim için bir metin altyazı ekleyebilirsiniz? LibreOffice'de bir metin yazısı oluşturduğumda, bir altyazının oluşturulduğu 'content.xml' bölümünün parçası buna benzer.
<draw:frame draw:style-name="fr1" draw:name="Frame1" text:anchor-type="as-char" svg:y="0cm" svg:width="4.001cm" draw:z-index="0">
<draw:text-box fo:min-height="12cm">
<text:p text:style-name="Caption">
<draw:frame draw:style-name="fr2" draw:name="Eiffel Tower" text:anchor-type="paragraph" svg:x="0.004cm" svg:y="0.002cm" svg:width="4.001cm" style:rel-width="100%" svg:height="12cm" style:rel-height="scale" draw:z-index="1">
<draw:image xlink:href="full/path/to/picture.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/>
</draw:frame>
test caption
</text:p>
</draw:text-box>
</draw:frame>
Ben bir çerçeve oluşturur ve ardından görüntüyü onun içinde bulunan altyazı metnini koyar düşünüyorum. Bu noktada kayboldum. Belgedeki öğelere çerçeve ekleme hakkında bir şey bulamadım.