Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Outputting to PDF simply? (http://www.velocityreviews.com/forums/t910571-outputting-to-pdf-simply.html)

bobm3@worthless.info 05-19-2009 02:34 PM

Outputting to PDF simply?
 
Fellow mongers...

I've searched CPAN as well as googled for numerous pdf creator
utilities. I've read about some of the perl modules available (i.e.:
PDF::API, PDF::Report, PDF::ReportWriter, etc).

I think all these are overkill for what I am trying to do. Perhaps
some of you can recommend a workable solution that I can research and
hopefully incorporate.

I have some perl programs that create business reports using the
write(format) feature (which works very well, BTW) and they are now
creating text output. I would like to have those converted to or
output directly as PDF's so they can be more easily opened for
viewing, searching and printing with Acrobat.

Any recommendations as to what my fill this bill with the least amount
of changes?

Thanks all for your kind and knowledgeable advice!

A. Sinan Unur 05-19-2009 02:52 PM

Re: Outputting to PDF simply?
 
bobm3@worthless.info wrote in news:bng515l0ltk5ftcd0i4nrs386ofc6cpcjp@
4ax.com:

> I have some perl programs that create business reports using the
> write(format) feature (which works very well, BTW) and they are now
> creating text output. I would like to have those converted to or
> output directly as PDF's so they can be more easily opened for
> viewing, searching and printing with Acrobat.


Run a2ps and ps2pdf on the output.

http://www.gnu.org/software/a2ps/

http://www.ghostscript.com/

Sinan

--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/

ccc31807 05-19-2009 03:07 PM

Re: Outputting to PDF simply?
 
On May 19, 10:34*am, bo...@worthless.info wrote:
> I have some perl programs that create business reports using the
> write(format) feature (which works very well, BTW) and they are now
> creating text output. *I would like to have those converted to or
> output directly as PDF's so they can be more easily opened for
> viewing, searching *and printing with Acrobat.


'Simple' might be in the eye of the beholder. I use PDF::API2. One of
the scripts I use it is for the creation of about 5,000 contracts five
times a year, and it does exactly what you would expect -- create
about 5,000 PDF documents, along with a cover letter and instructions.

Yes, you do have to write each line, but that's no harder than hand
writing HTML or creating a format, and it variable interpolates so you
can write templates. I've included a sample below.

CC

-----------sample using PDF::API2--------------------
$text->fillcolor('black');
$text->font( $font{'Times'}{'Bold'}, 11/pt );

$text->translate( 72, 580 );
$text->text("Greetings, $fac_contract{FIRST} $fac_contract{MIDDLE}
$fac_contract{LAST},");

$text->fillcolor('black');
$text->font( $font{'Times'}{'Roman'}, 11/pt );

$text->translate( 72, 560);
$text->text("The following is information for reviewing and
completing your Term $fac_contract{TERM} adjunct contract. After");

$text->translate( 72, 550);
$text->text("you have reviewed your contract, print and sign as
Faculty Appointee. Mail it to the address listed");

$text->translate( 72, 540);
$text->text("below as soon as possible.");

$text->font( $font{'Helvetica'}{'Bold'}, 12/pt );
$text->fillcolor('darkred');

$text->translate( 72, 500);
$text->text("Need to change your address, phone number?");

bobmct 05-20-2009 02:45 AM

Re: Outputting to PDF simply?
 
Thanks gents!

You've all given me good feedback to research and dabble with.

Much appreciated. B


All times are GMT. The time now is 04:31 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.