Skip Menu |
 

This queue is for tickets about the PDF-Template CPAN distribution.

Report information
The Basics
Id: 9836
Status: open
Priority: 0/
Queue: PDF-Template

People
Owner: RKINYON [...] cpan.org
Requestors: MidLifeXis-pdftemplate [...] wightmanfam.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.22
Fixed in: (no value)



Subject: Underline attribute on textbox
Download (untitled) / with headers
text/plain 253b
Hello, Added an underline attribute to a textbox element. It does this by using an ATTRIBUTES="underline=true" tag in the template. I am not necessarily married to this format. Perhaps an UNDERLINE="1" attribute would be just as well. Thanks, Brian
223a224,227 > my %attributes = split(/[=;]/, $context->get($self, 'ATTRIBUTES') || ''); > pdflib_pl::PDF_set_parameter($context->{PDF}, "underline", > $attributes{'underline'} || 'false'); > 375a380,387 > > =item * ATTRIBUTES > > Attach alternative PDFLib attributes to a textbox. Currently the only > attribute is B<underline>. Attributes are in the form "a=b;c=d" (a > split is done on '=' and ';'). > > <textbox ATTRIBUTES="underline=true">foobar underlined</textbox>
Subject: Underline (and other attributes) on textbox
From: OP - MidLifeXis [...] pm
Download (untitled) / with headers
text/plain 645b
Other attributes I may be interested in (this is some engineering document generation) would be the overstrike, overline, and textrise (super / subscript). See table 7.9 (p 148) in the PDFlib-manual.pdf document from the vendor. If I get a little bit of time, I will see if I can submit a patch to implement these. Thanks Brian [guest - Mon Jan 17 17:02:49 2005]: Show quoted text
> Hello, > > Added an underline attribute to a textbox element. > > It does this by using an ATTRIBUTES="underline=true" tag in the > template. I am not necessarily married to this format. Perhaps an > UNDERLINE="1" attribute would be just as well. > > Thanks, > Brian
From: MidLifeXis [...] pm
Download (untitled) / with headers
text/plain 1.7k
As promised - patches... Here is sample code to use these patches: <font face="Times-Roman" h="20"> <row> <textbox w="100%" underline="1">This is underlined</textbox> </row> <row> <textbox w="100%" overline="1">This is overline</textbox> </row> <row> <textbox w="100%" strikeout="1">This is strikeout</textbox> </row> <row> <textbox w="100%" underline="1" overline="1" strikeout="1">This is all three</textbox> </row> <row> <textbox w="100%">This is none</textbox> </row> <row> <textbox border="1" x="0i" w="50%">This is normal textrise</textbox> <textbox border="1" x="2.8i" w="50%" textrise="10">This is textrise=10</textbox> </row> <row border="0" w="25%"> <textbox x="0.0i" textrise="00">L</textbox> <font h="16"> <textbox x="0.05i" textrise="3">A</textbox> </font> <textbox x="0.15i" textrise="00">T</textbox> <textbox x="0.28i" textrise="-4">E</textbox> <textbox x="0.41i" textrise="00">X</textbox> </row> </font> [guest - Tue Jan 18 08:22:31 2005]: Show quoted text
> Other attributes I may be interested in (this is some engineering > document generation) would be the overstrike, overline, and textrise > (super / subscript). See table 7.9 (p 148) in the PDFlib-manual.pdf > document from the vendor. > > If I get a little bit of time, I will see if I can submit a patch to > implement these. > > Thanks > Brian > > [guest - Mon Jan 17 17:02:49 2005]: >
> > Hello, > > > > Added an underline attribute to a textbox element. > > > > It does this by using an ATTRIBUTES="underline=true" tag in the > > template. I am not necessarily married to this format. Perhaps an > > UNDERLINE="1" attribute would be just as well. > > > > Thanks, > > Brian
> >
*** /apps/perl/lib/site_perl/5.6.1/PDF/Template/Element/TextBox.pm Mon Nov 29 10:43:24 2004 --- PDF/Template/Element/TextBox.pm Tue Jan 18 08:20:59 2005 *************** *** 221,226 **** --- 221,251 ---- my $fsize = pdflib_pl::PDF_get_value($context->{PDF}, "fontsize", undef); $fsize = 0 if $fsize < 0; + if ($context->get($self, 'UNDERLINE')) { + pdflib_pl::PDF_set_parameter($context->{PDF}, "underline", "true"); + } else { + pdflib_pl::PDF_set_parameter($context->{PDF}, "underline", "false"); + } + + if ($context->get($self, 'OVERLINE')) { + pdflib_pl::PDF_set_parameter($context->{PDF}, "overline", "true"); + } else { + pdflib_pl::PDF_set_parameter($context->{PDF}, "overline", "false"); + } + + if ($context->get($self, 'STRIKEOUT')) { + pdflib_pl::PDF_set_parameter($context->{PDF}, "strikeout", "true"); + } else { + pdflib_pl::PDF_set_parameter($context->{PDF}, "strikeout", "false"); + } + + if (defined($context->get($self, 'TEXTRISE'))) { + pdflib_pl::PDF_set_value($context->{PDF}, "textrise", + $context->get($self, 'TEXTRISE')); + } else { + pdflib_pl::PDF_set_value($context->{PDF}, "textrise", 0); + } + # return $h unless $str->length && ($fsize && $h / $fsize >= 1); return $h unless length($str) && ($fsize && $h / $fsize >= 1); *************** *** 373,378 **** --- 398,436 ---- Set this to a true value and the height value will be a requirement, not an option. + + =item * UNDERLINE + + Underline the text in the current text box. + + <textbox underline="1">foobar underlined</textbox> + + =item * OVERLINE + + Overline the text in the current text box. + + <textbox overline="1">foobar overlined</textbox> + + =item * STRIKEOUT + + Strikeout the text in the current text box. + + <textbox strikeout="1">Casey has struck out</textbox> + + =item * TEXTRISE + + Apply a positive or negative text rise to the given text box. + + <font face="Times-Roman" h="20"> + <row border="0" w="25%"> + <textbox x="0.0i" textrise="00">L</textbox> + <font h="16"> + <textbox x="0.05i" textrise="3">A</textbox> + </font> + <textbox x="0.15i" textrise="00">T</textbox> + <textbox x="0.28i" textrise="-4">E</textbox> + <textbox x="0.41i" textrise="00">X</textbox> + </row> + </font> =back 4


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.