At 16:18 11/03/2002 -0600, Herbold, John W. wrote:
>Does anybody have an example or two of spitting out a result from a DBI call
>into a PDF file ?
>
>I am loosing what little hair I have left trying to get PDF::CREATE to put
>thing like I want them!
Only way I ever use PDF creators is through Apache's FOP.
(Formatting Object Processor). It takes an XML and XSL/XSL:FO input
and gives you lovely PDF.
It's not Perl, but it is very easy to use:
# eg:
$com = "java "
." -cp
build/fop.jar;lib/batik.jar;lib/xalan-2.0.0.jar;lib/xerces-1.2.3.jar;lib/jimi-1.0.jar"
." org.apache.fop.apps.Fop"
." -c conf/userconfig.xml"
. ($DEBUG ? ' -d' : '')
." -xsl $self->{pdf_xslt}"
." -xml $self->{xml_input_filename}"
." -pdf $self->{pdf_output_filename}";
$com=~s|/|\\|g;
warn "* Command: $com\n" if $DEBUG;
# $r = system $com;
$r = system $com;
warn "* \t...done.\n" if $DEBUG;
warn "* System said: <$r>\n" if $DEBUG;
if ($r == 0){
warn "* Seems okay!\n" if $DEBUG;
$r = 1;
} else {
warn "* Seems funny...\n" if $DEBUG;
$r = undef;
}
if (-e $self->{pdf_output_filename}){
warn "* Made PDF at $self->{pdf_output_filename}" if $DEBUG;
} else {
warn "* Did not make PDF at $self->{pdf_output_filename}";
warn "\t * Do you have java on the command line?";
$r = undef;
}
Worth looking into.
Lee