Reputation: 841
I want to create pdf using XSLT, ApacheFOP use in PERL. Can anyone Help me?
use 5.010;
use warnings;
use strict;
use XML::ApacheFOP;
my $Fop = XML::ApacheFOP->new();
$Fop->fop( xml => "math.xml", xsl => "math.xsl", outfile => "temp.pdf" ) or die "cannot create pdf: " . $Fop->errstr;
Error showing in cmd line can't locate XML/ApacheFOP.pm
Upvotes: 0
Views: 237
Reputation: 6798
The error indicates that your perl distro does not include XML::ApacheFOP
module.
The module can be installed in several ways:
cpan install XML::ApacheFOP
or
cpanm XML::ApacheFOP
or
perl -MCPAN -e install XML::ApacheFOP
or download module extract it and run makefile.
It was pointed out that this particular module has java as pre-requisite and should be installed as well.
FAQ installing CPAN perl modules
What's the easiest way to install perl module?
Upvotes: 0
Reputation: 69224
This is almost certainly because XML::ApacheFOP isn't installed. In a comment, you say that you have tried to install the module using cpanm
, but it hasn't installed successfully. It would be useful to see the error messages that are displayed.
The SETUP section of the documentation says that you will need FOP installed before installing the module. If you're on Ubuntu, then that might be as easy as running sudo apt-get install fop
. You should then try the module installation again. If it still fails, then ask a new question here, making sure to include the text of the error messages you get from cpanm
.
Upvotes: 1