Template-Flute-PDF
view release on metacpan or search on metacpan
to disappear in the PDF output.
[TESTS]
* Add basic text tests
0.0040 Mon May 21 10:48:20 2012 CEST
[ENHANCEMENTS]
* Get rid of Image::Magick prerequisite (rt.cpan.org #76005).
* Add support for min_width and min_height properties.
* Add support for font style properties.
* Add support for HTML <i> tag.
[BUGFIX]
* Fallback to file parameter from Template::Flute::PDF->new in process
method.
[TESTS]
lib/Template/Flute/PDF/Image.pm view on Meta::CPAN
only a limited range of formats.
=cut
sub convert {
my ($self, $format) = @_;
my ($magick, $msg, $tmph, $tmpfile);
$format ||= 'png';
eval "require Image::Magick";
die "Can't load Image::Magick for format $format: $@" if $@;
$self->{original_file} = $self->{file};
# create and register temporary file
($tmph, $tmpfile) = tempfile('temzooXXXXXX', SUFFIX => ".$format");
$self->{tmpfile} = $tmpfile;
$magick = Image::Magick->new;
if ($msg = $magick->Read($self->{file})) {
die "Failed to read picture from $self->{file}: $msg\n";
}
if ($msg = $magick->Write(file => $tmph, magick => $format)) {
die "Failed to write picture to $tmpfile: $msg\n";
}
$self->{file} = $tmpfile;
use Template::Flute::PDF;
use CAM::PDF;
use Test::More;
my ($spec, $html, $flute, $flute_pdf, $pdf, $cam, @images);
@images = qw/sample.jpg/;
eval "use Image::Magick";
unless ($@) {
push (@images, 'sample.bmp');
}
plan tests => 2 * @images;
$spec = q{<specification></specification>};
for my $pic (@images) {
( run in 0.371 second using v1.01-cache-2.11-cpan-beeb90c9504 )